-
Notifications
You must be signed in to change notification settings - Fork 41
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
Type children key statically #39
Comments
Why don't we throw in an |
We can have that; just that it's not clear whether it'll work out yet (not many people understand the semantics of nested arrays keys btw). In the meantime, having children statically typed would be great anyway! We can tackle on I'm thinking it's also not worse in terms of verbosity. Right now it's |
@chenglou can you explain the issues with nested arrays? |
We use currying for
ref
andkey
already. There might be some phantom types/GADT things we can use here to statically type the fact that childrenkey
exists. More info: https://github.com/reasonml/rehydrate/blob/6808bf1a19e701214e4456967b4aab155d79802c/src/reactRe.re#L60Alternatively, @jordwalke can take the occasion to design this away without needing fancy types, with his OrderedMap idea (jordan can talk more about this).
The benefit is that this is the last feature we need in order to completely bypass createElement (which sets up the key warning, that we currently piggyback on), and make every JSX render twice faster.
The text was updated successfully, but these errors were encountered: