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

Support for props spread #2570

Open
rickyvetter opened this issue May 5, 2020 · 0 comments
Open

Support for props spread #2570

rickyvetter opened this issue May 5, 2020 · 0 comments
Labels
RFC For larger proposals/ideas that will need discussion

Comments

@rickyvetter
Copy link
Contributor

rickyvetter commented May 5, 2020

Support for this syntax would be helpful for ReasonReact:

<div {...props} />

Conceptually it maps to a component whose total set of props has been created elsewhere. I'd propose that it could desugar to:

let _ = ((div props)[@JSX ])

Importantly - I don't think that it's useful or interesting (for the purposes of ReasonReact at least) to support props spread+individual props. I am not asking for support for either of:

<div {...props} somethingElse=1 />;

<div {...props}> somethingElse </div>

For context on why I want this - today RR components are a set of two functions - x and xProps in the same module scope. Sometimes folks want to (or can only) make a component which is just x. This syntax allows them to do so and get the props through any means that they'd like while still being able to use JSX.

@davesnx davesnx added the RFC For larger proposals/ideas that will need discussion label Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFC For larger proposals/ideas that will need discussion
Projects
None yet
Development

No branches or pull requests

2 participants