-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React16 #24
React16 #24
Conversation
src/util.js
Outdated
@@ -58,19 +58,23 @@ const getOptions = (options, value = [], level = 0) => { | |||
if (level === 0 && options) { | |||
return options; | |||
} | |||
console.log("getOptions", options, value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console log 是否要删除,看这里好像不是一个 warning 相关的
src/CascadeSelect.jsx
Outdated
@@ -180,10 +193,10 @@ class CascadeSelect extends SuperComponent { | |||
recursive(); | |||
} | |||
|
|||
getSelectedOptions(props) { | |||
static getSelectedOptions(props, state) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static 应该放在实例之前。
src/CascadeSelect.jsx
Outdated
@@ -16,23 +16,24 @@ import CascadeSubmenu from './CascadeSubmenu'; | |||
import SuperComponent from './SuperComponent'; | |||
import Search from './Search'; | |||
|
|||
import { find, getArrayLeafItemContains, deepCopy, getOptions } from './util'; | |||
import { find, getArrayLeafItemContains, deepCopy, getOptions, stringify } from './util'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用了新的声明周期,但是没有加 polyfill
src/CascadeSelect.jsx
Outdated
if ( | ||
onSelect && judgeValue || judgeOptions | ||
) { | ||
this.setValue(this.props); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
追了一下,发现 setValue 最终会触发 setState,那么最好不要在 didUpdate 里调用,最好进一步拆解到 gDSFP 里
fix: upgrade to support reac16