-
Notifications
You must be signed in to change notification settings - Fork 172
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
React Component in the Portal (Legacy) #185
Comments
Hey @hatpick and @tajo , I just ran into this, and have a fix; here was the problematic code:
Render portal gets called, but this is before the new props are received. I'm game to fix this in a variety of ways, but the easy one liner was changing I'm about to make a PR for this, @tajo let me know what you think. #187 |
@uforic It doesn't work for me, are you using mobx or state? |
Hm, I'm using state - but this was an issue with showing the latest props, not state related; if you put a breakpoint in LegacyPortal.jsx / componentWillReceiveProps, you should be able to see the state of the children about to be rendered (in the props.children variable), and verify that when this.renderPortal gets called, it's using the previous props that have an older version of the children. Definitely possible there is something else going on, but if the behavior you're seeing is props are running "a little behind", this could be it. |
actually, I take my last comment back, your fix work. ty |
issue #185: fix out of date props render bug
Here's what I have:
The problem is when I call my toggle to show the portal, the component inside it doesn't show the latest data received as props. Any ideas?
The text was updated successfully, but these errors were encountered: