-
Notifications
You must be signed in to change notification settings - Fork 38
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
Inconsistent defaultProps behavior in debug / no debug mode #131
Comments
@kLabz I'm looking at the |
Ooooh I got it @djaonourside When inlined, the defaultProps are added as spread and plucked to remove the props passed at compile time. Effectively, if @kLabz do you have an idea on how to solve this? |
I'm not sure what change you are talking about. I handled the issue in react-next (last 4 commits here -- diff) but haven't had time to extract it in a PR here yet. I think the issue has always existed here, since the behavior is different at its core: in haxe-react we use the default prop if the prop is not passed while reactjs uses the default prop for every prop that as So if we end up passing |
Originally I was de-optimising components with default props completely, so it was going through |
I have no memory of either components being de-optimised when they had default props or changing anything about that. Original implementation seemed to already have the issue. |
@kLabz you're right, it's from my original code 😅. I guess the solution is to never remove fields from defaultProps. |
Doesn't work either, if you pass |
Damn you can overwrite with |
It's not picked up default props if they aren't passed from parent component in no debug mode. Maybe react inlining problem:
https://try.haxe.org/#1489A
The text was updated successfully, but these errors were encountered: