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 #12

Merged
merged 5 commits into from
Jun 21, 2018
Merged

React16 #12

merged 5 commits into from
Jun 21, 2018

Conversation

ustczy
Copy link
Collaborator

@ustczy ustczy commented Jun 13, 2018

update react 16

@coveralls
Copy link

coveralls commented Jun 14, 2018

Coverage Status

Coverage increased (+0.5%) to 92.677% when pulling ef05b11 on ustczy:react16 into c311493 on uxcore:master.

src/Album.jsx Outdated
constructor(props) {
super(props);
this.state = {
open: false,
current: props.current,
left: 0,
top: 0,
lastIndex: 0,
Copy link
Member

Choose a reason for hiding this comment

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

这个 lastIndex 应该也是用 props.current 来生成,这样才可以避免,mount 时候走两遍逻辑。

src/Album.jsx Outdated
}
};

export default polyfill(Album);
Copy link
Member

Choose a reason for hiding this comment

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

按照 https://github.com/reactjs/react-lifecycles-compat 标准用法,应该 polyfill(Album); 再 export default Album 更靠谱一些。

src/Carousel.jsx Outdated
this.state = {
left: 0,
top: 0,
lastIndex: 0,
Copy link
Member

Choose a reason for hiding this comment

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

这里同上,lastIndex 作为 current 的 mirror,应该在 constructor 中也用 current 来生成。

src/Viewer.jsx Outdated
scale: 1,
current: props.current,
lastOpenStatus: false,
Copy link
Member

Choose a reason for hiding this comment

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

此处同上。

src/Carousel.jsx Outdated
@@ -180,3 +190,5 @@ export default class Carousel extends React.Component {
);
}
}

export default polyfill(Carousel);
Copy link
Member

Choose a reason for hiding this comment

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

polyfill 同上。

src/Viewer.jsx Outdated
@@ -265,3 +276,5 @@ Viewer.propTypes = {
};

Viewer.displayName = 'Viewer';

export default polyfill(Viewer);
Copy link
Member

Choose a reason for hiding this comment

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

polyfill 同上。

@eternalsky
Copy link
Member

没啥问题了,可以和 文肇 商量下,看谁来发。

@ustczy ustczy closed this Jun 20, 2018
@ustczy
Copy link
Collaborator Author

ustczy commented Jun 20, 2018

reopen pr for merging

@ustczy ustczy reopened this Jun 20, 2018
@ustczy ustczy merged commit 5088363 into uxcore:master Jun 21, 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

3 participants