question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React context is not available inside onRenderTab when dragging the tab after updating to 0.6.0

See original GitHub issue

I use React’s context and more specifically useSelector from react-redux in a component which I set in renderValues.content of the onRenderTab. When I drag the tab, I get the following error: Uncaught Error: could not find react-redux context value; please ensure the component is wrapped in a <Provider>.

I get this error only in 0.6.0 version.

You can see the problem in the CodeSandbox below.

https://codesandbox.io/s/flexlayout-react-forked-l1shf

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
nealuscommented, Nov 26, 2021

I’ve published v0.6.1 with the change

1reaction
nealuscommented, Nov 25, 2021

I’ve just pushed a change that uses React portals rather than ReactDOM.render, this should keep the context in the onRenderTab callback.

Can you try the latest code and see if that fixes your problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React context not updating - Stack Overflow
In this case your AppWrapper where you render the context provider is where you need to track state. import React, {useContext, useState, ...
Read more >
FlexLayout/ChangeLog.txt at master - GitHub
Use portal for drag rectangle to preserve React context in onRenderTab. 0.6.0. Changed icons to use svg images, these will now scale with...
Read more >
uncaught error: could not find react-redux context value
caplin/FlexLayoutReact context is not available inside onRenderTab when dragging the tab after updating to 0.6.0#285. Created 12 months ago.
Read more >
Context - React
Context provides a way to pass data through the component tree without having to pass props down manually at every level. In a...
Read more >
storybook-react-context - npm
Manipulate React context inside Storybook. Read state and dispatch updates from outside of React component.. Latest version: 0.6.0, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found