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

props vs Record props #161

Closed
safareli opened this issue Nov 27, 2018 · 2 comments
Closed

props vs Record props #161

safareli opened this issue Nov 27, 2018 · 2 comments

Comments

@safareli
Copy link
Contributor

In types of *component* functions we have Record props instead of props, why is that the case?

for example Record from writeState can be removed (pr #160) and I suppose it could be done for some of this *component* functions too.

@natefaubion
Copy link
Contributor

natefaubion commented Nov 27, 2018

React does not treat props and state parametrically. If we wanted a parametric type we would have to box it anyway (which is what this library used to do), and is what purescript-react-basic does but this breaks things like pureComponent, or any new utilities like memo. We would have to write our own versions which deal with that. My impression of purescript-react is that it attempts to provide typed bindings for the API as is, for better or for worse.

@safareli
Copy link
Contributor Author

:( will close #160 then. thanks for the clarification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants