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

Support React Context #979

Closed
theKashey opened this issue May 16, 2018 · 9 comments
Closed

Support React Context #979

theKashey opened this issue May 16, 2018 · 9 comments

Comments

@theKashey
Copy link
Collaborator

No description provided.

@bbenezech
Copy link

bbenezech commented May 18, 2018

In my app with 4.2.0, components nested in context Providers lose their state when hot reloading happens.
Is this expected atm? (-> basic support)

Thank you very much for the awesome support.

@theKashey
Copy link
Collaborator Author

Yeah, that was a basic update. Unfortunately, RHL does not contain any context related tests, as long enzyme still does not support them, as result some bugs exists.

So - the fix for your problem is almost ready - #983

@Cottin
Copy link

Cottin commented May 28, 2018

rhlerror

I get the above error when using Context. You've seen this before? Me doing something wrong?

@theKashey
Copy link
Collaborator Author

@Cottin - click on f and try to figure out that is it. This is not Context, just something with context.
And that "something" got required before hot-loader.

@NervosaX
Copy link

NervosaX commented Jun 4, 2018

When making changes in my react component, inside a context provider, I get errors on this line:

56fdd05#diff-56f32a77d9820e3b9dc60ca87529a61cR341

saying that props is undefined on the child variable. Changing this to nextProps seems to solve the issue.

if (isContextProvider(child)) {
  extraContext = new Map(extraContext);
  extraContext.set(getContextProvider(child.type), child.nextProps.value);
  childName = 'ContextProvider';
}

@theKashey
Copy link
Collaborator Author

@NervosaX - changes are already in master. I need to fix #1001 and then will release a new version.
Unfortunately current version contain very nasty, almost buggy, behavior :(

@NervosaX
Copy link

NervosaX commented Jun 4, 2018

@theKashey All good, I'll use my hack until then. Good luck!

@NervosaX
Copy link

NervosaX commented Jun 6, 2018

Looks like 4.3.0 fixes this issue, can probably close this ticket now!

@theKashey
Copy link
Collaborator Author

👍

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

4 participants