Skip to content
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

Merged
merged 9 commits into from
Jun 29, 2018
Merged

React16 #24

merged 9 commits into from
Jun 29, 2018

Conversation

weifengHuang
Copy link
Contributor

fix: upgrade to support reac16

@coveralls
Copy link

coveralls commented Jun 21, 2018

Coverage Status

Coverage decreased (-0.7%) to 87.819% when pulling eff3c54 on weifengHuang:react16 into 21323d9 on uxcore:master.

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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console log 是否要删除,看这里好像不是一个 warning 相关的

@@ -180,10 +193,10 @@ class CascadeSelect extends SuperComponent {
recursive();
}

getSelectedOptions(props) {
static getSelectedOptions(props, state) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static 应该放在实例之前。

@@ -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';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

使用了新的声明周期,但是没有加 polyfill

if (
onSelect && judgeValue || judgeOptions
) {
this.setValue(this.props);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

追了一下,发现 setValue 最终会触发 setState,那么最好不要在 didUpdate 里调用,最好进一步拆解到 gDSFP 里

@lpgray lpgray merged commit 6737189 into uxcore:master Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants