-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed
Labels
upstreamUpstream tracked issue.Upstream tracked issue.
Description
So I am currently using the OverLay
and ToolTip
and the following errors with React.StrictMode
appear:
game.js:18461 Warning: Unsafe lifecycle methods were found within a strict-mode tree:
componentWillReceiveProps: Please update the following components to use static getDerivedStateFromProps instead: WaitForContainer
Learn more about this warning here:
https://fb.me/react-strict-mode-warnings
warningWithoutStack @ game.js:18461
(anonymous) @ game.js:28408
./node_modules/react-dom/cjs/react-dom.development.js.ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings @ game.js:28385
commitAllLifeCycles @ game.js:35528
callCallback @ game.js:18104
invokeGuardedCallbackDev @ game.js:18154
invokeGuardedCallback @ game.js:18211
commitRoot @ game.js:35737
completeRoot @ game.js:37189
performWorkOnRoot @ game.js:37144
performWork @ game.js:37019
performAsyncWork @ game.js:36993
flushFirstCallback @ game.js:44595
flushWork @ game.js:44707
./node_modules/scheduler/cjs/scheduler.development.js.channel.port1.onmessage @ game.js:45068
game.js:18461 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of RefHolder which is inside StrictMode. Instead, add a ref directly to the element you want to reference.
in div (created by Map)
in RefHolder (created by OverlayTrigger)
in OverlayTrigger (created by Map)
in div (created by Map)
in div (created by Map)
in div (created by Map)
in div (created by Map)
in div (created by Map)
in Map (created by CharacterSideDetails)
in div (created by CharacterSideDetails)
in CharacterSideDetails (created by Game)
in div (created by Game)
in div (created by Game)
in div (created by Game)
in Game
in ConcurrentMode
Learn more about using refs safely here:
https://fb.me/react-strict-mode-find-node
warningWithoutStack @ game.js:18461
findHostInstanceWithWarning @ game.js:37412
findDOMNode @ game.js:37914
OverlayTrigger._this.getTarget @ game.js:15208
getTarget @ game.js:39973
componentDidMount @ game.js:39956
commitLifeCycles @ game.js:34172
commitAllLifeCycles @ game.js:35541
callCallback @ game.js:18104
invokeGuardedCallbackDev @ game.js:18154
invokeGuardedCallback @ game.js:18211
commitRoot @ game.js:35737
completeRoot @ game.js:37189
performWorkOnRoot @ game.js:37144
performWork @ game.js:37019
performAsyncWork @ game.js:36993
flushFirstCallback @ game.js:44595
flushWork @ game.js:44707
./node_modules/scheduler/cjs/scheduler.development.js.channel.port1.onmessage @ game.js:45068
game.js:18461 Warning: Legacy context API has been detected within a strict-mode tree:
Please update the following components: Transition
Learn more about this warning here:
https://fb.me/react-strict-mode-warnings
warningWithoutStack @ game.js:18461
(anonymous) @ game.js:28572
./node_modules/react-dom/cjs/react-dom.development.js.ReactStrictModeWarnings.flushLegacyContextWarning @ game.js:28562
commitAllLifeCycles @ game.js:35529
callCallback @ game.js:18104
invokeGuardedCallbackDev @ game.js:18154
invokeGuardedCallback @ game.js:18211
commitRoot @ game.js:35737
completeRoot @ game.js:37189
performWorkOnRoot @ game.js:37144
performWork @ game.js:37019
performAsyncWork @ game.js:36993
flushFirstCallback @ game.js:44595
flushWork @ game.js:44707
./node_modules/scheduler/cjs/scheduler.development.js.channel.port1.onmessage @ game.js:45068
game.js:18461 Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of Transition which is inside StrictMode. Instead, add a ref directly to the element you want to reference.
in div (created by Tooltip)
in Tooltip (created by Context.Consumer)
in ForwardRef(Bootstrap(Tooltip)) (created by InnerPopper)
in Transition (created by Fade)
in Fade (created by InnerPopper)
in InnerPopper (created by Context.Consumer)
in Popper (created by Overlay)
in WaitForContainer (created by Portal)
in Portal (created by Overlay)
in Overlay (created by WaitForContainer)
in WaitForContainer (created by ForwardRef(withContainer(Overlay)))
in ForwardRef(withContainer(Overlay)) (created by Overlay)
in Overlay (created by OverlayTrigger)
in OverlayTrigger (created by Map)
in div (created by Map)
in div (created by Map)
in div (created by Map)
in div (created by Map)
in div (created by Map)
in Map (created by CharacterSideDetails)
in div (created by CharacterSideDetails)
in CharacterSideDetails (created by Game)
in div (created by Game)
in div (created by Game)
in div (created by Game)
in Game
in ConcurrentMode
Learn more about using refs safely here:
https://fb.me/react-strict-mode-find-node
You might be thinking, these come from your app and your components. But If I take out, in the map.jsx
component:
renderPortPins() {
let portPins = [];
this.state.ports.forEach((port) => {
portPins.push(
<OverlayTrigger
key={port.id}
placement={'top'}
overlay={
<Tooltip id={`tooltip-top`}>
{port.name}
</Tooltip>
}
>
<div key={port.id} className="map-port-pin" style={{top: port.y + 'px', left: port.x + 'px'}}></div>
</OverlayTrigger>
)
});
return portPins
}
Then the errors go away. But I would rather keep the tooltips.
I wouldn't say this is something you have to fix right now, but its something to keep in mind.
buren, makhataibar, ctafield, kristian-94, bakgaard and 6 more
Metadata
Metadata
Assignees
Labels
upstreamUpstream tracked issue.Upstream tracked issue.