rescript-react icon indicating copy to clipboard operation
rescript-react copied to clipboard

Add suppressHydrationWarning to ReactDOM.domProps

Open jderochervlk opened this issue 1 year ago • 5 comments

Not sure if this a a good approach, but here's my thoughts:

If we want to make JSX not directly connected to React, we should move React specific JSX props out of the compiler and into React. With the type spreading this is easy to do. There are probably others we could move over here to keep JSX props cleaner, but this seems like a good start.

Fixes https://github.com/rescript-lang/rescript-react/issues/102

jderochervlk avatar May 17 '24 15:05 jderochervlk

I just ran a cycle of clean and build a few times to see if there is a difference, and it takes about the same time either way, around 250-280ms.

jderochervlk avatar May 17 '24 16:05 jderochervlk

It's been a while, but do we want to merge this in?

jderochervlk avatar Dec 03 '24 15:12 jderochervlk

Just tested this in a project of ours and it worked fine. @mununki Any concerns from your part?

There are more React-specific props though: https://react.dev/reference/react-dom/components/common#common-props.

Shouldn't we investigate moving more of them from the JsxDOM.domProps definition in the compiler to the React bindings? E.g., suppressContentEditableWarning?

cknitt avatar Dec 07 '24 07:12 cknitt

Just tested this in a project of ours and it worked fine. @mununki Any concerns from your part?

There are more React-specific props though: react.dev/reference/react-dom/components/common#common-props.

Shouldn't we investigate moving more of them from the JsxDOM.domProps definition in the compiler to the React bindings? E.g., suppressContentEditableWarning?

I think doing a larger pass on this would be a good way to go, yeah.

Just tested this in a project of ours and it worked fine. @mununki Any concerns from your part?

There are more React-specific props though: react.dev/reference/react-dom/components/common#common-props.

Shouldn't we investigate moving more of them from the JsxDOM.domProps definition in the compiler to the React bindings? E.g., suppressContentEditableWarning?

I have no particular concerns about this.

mununki avatar Dec 10 '24 01:12 mununki