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

Warnings when using StrictMode #1063

Closed
arnaudvalle opened this issue Jan 21, 2019 · 1 comment
Closed

Warnings when using StrictMode #1063

arnaudvalle opened this issue Jan 21, 2019 · 1 comment

Comments

@arnaudvalle
Copy link

Bug or feature request?

Bug

Expected behavior

No warnings when using react-beautiful-dnd with React.StrictMode.

Actual behavior

Warnings show up when using react-beautiful-dnd with React.StrictMode.

Steps to reproduce

  1. Use the vertical list example as a starting point (https://codesandbox.io/s/k260nyxq9v)
  2. Wrap the <App /> component in <React.StrictMode> (or go straight to the following fork: https://codesandbox.io/s/3xy8342pzp)
  3. See the warnings in the Console:
Warning: Unsafe lifecycle methods were found within a strict-mode tree:

componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead: Connect(Draggable), Connect(Droppable)

componentWillUpdate: Please update the following components to use componentDidUpdate instead: Connect(Draggable), Connect(Droppable)

Learn more about this warning here:
https://fb.me/react-strict-mode-warnings
  1. When using the latest version of React (16.7.0), I get additional warnings about the Legacy API (same code change as in step 3 but with I additionally update to React & ReactDOM 16.7.0 - or via this fork: https://l5o4y8xoxq.codesandbox.io/):
Warning: Legacy context API has been detected within a strict-mode tree: 
    in StrictMode

Please update the following components: Connect(Draggable), Connect(Droppable), DragDropContext, DragHandle, Draggable, DraggableDimensionPublisher, Droppable, DroppableDimensionPublisher

Learn more about this warning here:
https://fb.me/react-strict-mode-warnings

What version of React are you using?

16.7.0

What version of react-beautiful-dnd are you running?

10.0.3

What browser are you using?

Chrome 71.0.3578.98

Demo

https://l5o4y8xoxq.codesandbox.io/

PS: thanks for the great work on this repo 👍

@alexreardon
Copy link
Collaborator

Thanks! We are currently using an older version of react-redux that uses the deprecated methods. To upgrade will be a breaking change as our react peer dependency version will change #984

We will need to do this soon

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