React-beautiful-dnd: Warnings when using StrictMode

Created on 21 Jan 2019  路  1Comment  路  Source: atlassian/react-beautiful-dnd

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 馃憤

Most helpful comment

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

>All comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

heymartinadams picture heymartinadams  路  3Comments

jasonlewicki picture jasonlewicki  路  3Comments

JESii picture JESii  路  3Comments

WJKwok picture WJKwok  路  3Comments

crapthings picture crapthings  路  3Comments