-
Notifications
You must be signed in to change notification settings - Fork 351
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
Docs: add explanation for how to import components with default props. #573
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just shadowing the makeProps
function feels more lightweight to me. Having the original bindings around can be usefull if someone wanted to have several different derivations of the bound component.
Shadowing It feels a bit hacky to me though, so I was hesitant to put it in the PR. But I don’t mind adding it if we all think it’s worth mentioning. module Greeting = {
[@bs.module "./MyJavascriptFile.js"] [@react.component]
external make: (~name: string) => React.element = "default";
let makeProps = (~name="Peter", unit) => makeProps(~name, unit);
};
let f = () => <Greeting /> |
Hey thanks so much, just a few nits 😄 |
Co-authored-by: Peter Piekarczyk <peterpme@users.noreply.github.com>
Co-authored-by: Peter Piekarczyk <peterpme@users.noreply.github.com>
Thank you! |
This question comes up regularly on Discord.