Skip to content

Conversation

@Freddy03h
Copy link
Collaborator

Most of the APIs described on the changelog

  • <Activity>
  • useEffectEvent
  • cacheSignal => I don't plan to do it on this PR, because other RSC stuffs are missing
  • New React DOM Features for partial pre-rendering

[Read more on the React Documentation](https://react.dev/reference/react/Activity)
*/
module Activity = {
type mode = [#visible | #hidden]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we shouldn't rather do

type mode =
  | @as("visible") Visible
  | @as("hidden") Hidden

?

I know that's not how we did it for domProps and also not for the React Native bindings, but I think that was because @as for variant constructors was not available at the time of their writing.

In general, these days I would only use polymorphic variants instead of normal variants when there is a good reason to do so.

One example for use of normal variants everywhere are the rescript-mui bindings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants