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

Refactor PanResponder example to avoid componentWillMount() #233

Closed
benadamstyles opened this issue Mar 5, 2018 · 3 comments
Closed

Refactor PanResponder example to avoid componentWillMount() #233

benadamstyles opened this issue Mar 5, 2018 · 3 comments

Comments

@benadamstyles
Copy link
Contributor

React Native v0.54 uses React v16.3, which deprecates various lifecycle methods including componentWillMount(). In the PanResponder docs, the recommended approach is to set up PanResponder methods in componentWillMount(). Could the docs now be updated with the recommended replacement approach?

@andrwsalcdo
Copy link
Contributor

andrwsalcdo commented May 16, 2018

I could take this on. I imagine the recommended approach would be initializing state or in the constructor.

However, would it be best to add a description or a link describing the various lifecycle changes either in Update on Async Rendering or deprecates various lifecycle methods that @Leeds-eBooks mentioned?

I mention this, because I have beginners in mind.

@charpeni
Copy link
Contributor

Thank you for taking this @andrwsalcdo.

would it be best to add a description or a link describing the various lifecycle changes

Where would you add this? If it's inside the PanResponder docs, I don't think it worth mentioning as after the refactoring, beginners won't notice the changes from the previous version.

@andrwsalcdo
Copy link
Contributor

ah fair, but for those beginners that were learning from outdated resources? eh, it's probably a bit of a stretch, but I thought I ask.

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

No branches or pull requests

3 participants