-
Notifications
You must be signed in to change notification settings - Fork 349
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
Document Melange on website #734
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.
Mostly looks good with some small issues
@@ -113,7 +113,7 @@ Reason also always opts for the safest form of a given hook as well. So `React.u | |||
|
|||
## Hand-writing components | |||
|
|||
You don't need to use the `[@react.component]` declaration to write components. Instead you can write a pair of `foo` and `fooProps` functions such that `type fooProps: 'a => props and foo: props => React.element` and these will always work as React components! This works with your own version of [`[@bs.obj]`](https://bucklescript.github.io/docs/en/object-2#function), [`[bs.deriving abstract]`](https://bucklescript.github.io/docs/en/object#record-mode), or any other function that takes named args and returns a single props structure. | |||
You don't need to use the `[@react.component]` declaration to write components. Instead you can write a pair of `foo` and `fooProps` functions such that `type fooProps: 'a => props and foo: props => React.element` and these will always work as React components! This works with your own version of [`[@bs.obj]`](https://melange.re/v1.0.0/communicate-with-javascript/#using-jst-objects), [`[bs.deriving abstract]`](https://melange.re/v1.0.0/communicate-with-javascript/#convert-records-into-abstract-types), or any other function that takes named args and returns a single props structure. |
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.
Not a problem with your edit, but I don't understand the meaning of "This works with your own version of ...". Why would the reader have their own version of bs.obj and bs.deriving?
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.
Good point
Co-authored-by: Feihong Hsu <feihong.hsu@gmail.com>
Co-authored-by: Feihong Hsu <feihong.hsu@gmail.com>
Co-authored-by: Feihong Hsu <feihong.hsu@gmail.com>
Co-authored-by: Feihong Hsu <feihong.hsu@gmail.com>
Co-authored-by: Feihong Hsu <feihong.hsu@gmail.com>
Co-authored-by: Feihong Hsu <feihong.hsu@gmail.com>
Co-authored-by: Feihong Hsu <feihong.hsu@gmail.com>
Co-authored-by: schinns <schinn.ben@gmail.com>
No description provided.