Closed frankcalise closed 4 years ago
Yes, i had plan to use hook to restructure it.
I had restructure it by hooks.
Unable to use ref now, see error below:
<DraggableGrid ref={grid => this.grid = grid} numColumns={3} renderItem={this.renderItem} data={this.state.photos} onDragRelease={this.onDragRelease} onDragStart={this.onDragStart} />
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s%s,
Unable to use ref now, see error below:
<DraggableGrid ref={grid => this.grid = grid} numColumns={3} renderItem={this.renderItem} data={this.state.photos} onDragRelease={this.onDragRelease} onDragStart={this.onDragStart} />
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?%s%s,
I want to know why do you want to use ref?
My mistake, it was legacy code left in place by mistake (sorry, I just joined project using your library). Thanks for your help! Lifecycle warnings are gone.
Both lifecycle methods, componentWillMount and componentWillReceiveProps are being deprecated and will not be supported in React 17.
Warnings spit out now but will need to move to UNSAFE_X, where X is the method going forward. However, it would be best if could just move to componentDidMount and componentDidUpdate.
Any plans for fixing this?
See more details here: https://reactjs.org/blog/2018/03/29/react-v-16-3.html