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

mounting issue #157

Open
markentingh opened this issue Sep 29, 2018 · 1 comment
Open

mounting issue #157

markentingh opened this issue Sep 29, 2018 · 1 comment

Comments

@markentingh
Copy link

When dragging a component, I noticed that the component being dragged executes the componentWillMount method upon drag start. I believe that this would be a bug. The component shouldn't have to remount just to be dragged.

In my case, I have a component that does some heavy processing upon being mounted, therefore, when I try to sort components, there is some huge lag between pressing and dragging the selected component.

@madandrija
Copy link

componentWillMount is now eligible for removal:

Warning: componentWillMount has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

  • Move code with side effects to componentDidMount, and set initial state in the constructor.

  • Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

Please update the following components: SortableListView

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

2 participants