-
-
Notifications
You must be signed in to change notification settings - Fork 93
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
defaultProps treated differently than in preact #58
Comments
Hi @ftes! You're right, we're not handling undefined/null correctly in render-to-string. |
ftes
pushed a commit
to ftes/preact-render-to-string
that referenced
this issue
Aug 7, 2018
- mimick preact behaviour - fix preactjs#58
Sure thing, PR created @developit |
developit
pushed a commit
that referenced
this issue
Aug 16, 2018
- mimick preact behaviour - fix #58
Thanks, it's out in 3.8.1! |
marvinhagemeister
pushed a commit
to preactjs/preact
that referenced
this issue
Mar 15, 2022
- mimick preact behaviour - fix preactjs/preact-render-to-string#58
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This library behaves differently than preact when dealing with
undefined
prop values.Expected behaviour:
preact-render-to-string
should behave likepreact
:MyComponent.defaultProps.someProp = 'X'
)undefined
is passed as prop value (<MyComponent someProp={undefined}/>
)console.log(this.props.someProp) >> 'X'
)Actual behaviour:
If
undefined
is passed as prop value, thenthis.props.someProp
resolves toundefined
.Here you can see how the implementation in
preact
andpreact-render-to-string
differ:The text was updated successfully, but these errors were encountered: