Conversation
docs/components.md
Outdated
| ## 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://melange.re/v2.0.0/communicate-with-javascript/#using-jst-objects), [`[bs.deriving abstract]`](https://melange.re/v2.0.0/communicate-with-javascript/#convert-records-into-abstract-types), 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 [`[@mel.obj]`](https://melange.re/v4.0.0/communicate-with-javascript#using-js-t-objects), [`[bs.deriving abstract]`](https://melange.re/v4.0.0/communicate-with-javascript#using-external-functions), or any other function that takes named args and returns a single props structure. |
There was a problem hiding this comment.
we may need some kind of way to centrally update the melange version that we talk about.
There was a problem hiding this comment.
true, maybe move all links into references might make our lives easier, but having a link that points to "latest" might be a better idea
docs/context.md
Outdated
| }; | ||
| ``` | ||
|
|
||
| That will give you a `ContextProvider` component you can use in your application later on, by wrapping any component with `ContextProvider`, to have access to the context value inside the component tree. To know more about Context, check the [official React documentation](https://legacy.reactjs.org/docs/context.html) and [when to use it](https://react.dev/learn/passing-data-deeply-with-context). |
There was a problem hiding this comment.
should we update the legacy doc to https://react.dev/reference/react/createContext?
| - `renderToString` : `React.element => string` | ||
| - `renderToStaticMarkup` : `React.element => string` | ||
|
|
||
| More info about `ReactDOMServer` can be found in the [official React documentation](https://react.dev/reference/react-dom/server). |
There was a problem hiding this comment.
we should add a small section about ReactDOMServerNode, which you can get by depending on reason-react.node
docs/element-type-is-invalid.md
Outdated
| @@ -15,13 +15,13 @@ This likely means that: | |||
| This is a common mistake. Please see Melange's [Import an ES6 Default Value](https://melange.re/v2.0.0/communicate-with-javascript/#default-es6-values). Aka, instead of: | |||
There was a problem hiding this comment.
I saw you updated the link to point to v4 above. we should likely update the melange doc links across the entire docs to be consistent, in that case.
| }; | ||
| ``` | ||
|
|
||
| ## Using Event values with useState |
There was a problem hiding this comment.
this is duplicated from docs/usestate-event-value.md. are you planning to delete that page?
Co-authored-by: Antonio Nuno Monteiro <[email protected]>
Co-authored-by: Antonio Nuno Monteiro <[email protected]>
Co-authored-by: Antonio Nuno Monteiro <[email protected]>
Co-authored-by: Antonio Nuno Monteiro <[email protected]>
* 'main' of github.com:/reasonml/reason-react: Documentation updates for 0.16 (#864)
CHANGES: * FEATURE: add color to domProps (@tatchi in reasonml/reason-react#871) * BREAKING: Support for React 19 (@davesnx in reasonml/reason-react#846) * DOCS: Documentation updates for 0.16 (@davesnx in reasonml/reason-react#864) * INFRA: Update deps (@johnhaley81 in reasonml/reason-react#876) * INFRA: update setup-ocaml to v3 (@anmonteiro in reasonml/reason-react#878) * FIX: Remove raise annotations and fix locations on errors (@davesnx reasonml/reason-react#863) * FIX: type of pipeable stream to allow objects with keys (@anmonteiro in reasonml/reason-react#854) * FEATURE: Add `preconnect`, `prefetchDNS`, `preinit`, `preinitModule`, `preload` and `preloadModule` in ReactDOM.Experimental (@r17x in reasonml/reason-react#849) * BREAKING: Make lowerbound be Melange 5.1 (due to Js.FormData.t usage)
ReactEvent->React.Eventin docs #831)