rescript-lang / rescript-react

Official ReScript bindings for ReactJS

Home Page:https://rescript-lang.org/docs/react/latest/introduction

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

V3 compatibility does not seem to work with lowercase JSX

cristianoc opened this issue · comments

Example (built in v3 mode):

open ReactV3
let _ = <div name="" /> // The value domProps can't be found in ReactDOMRe

CC @mattdamon108

Can you share the deps? compiler and rescript-react?

"rescript": "^10.1.0-rc.2"
"@rescript/react": "^0.11.0-rc.1"

I’ll check and let you know.

I think this error is caused by removing include ReactDOM.Props https://github.com/rescript-lang/rescript-react/pull/65/files which is still used by V3. I think I need to revert it include ReactDOM_V3.Props back to fix the build issue.
What do you think? @cknitt

If it's only about this one type, then I'd prefer to just add

type domProps = ReactDOM_V3.domProps

to legacy/ReactDOMRe.res.

If it's only about this one type, then I'd prefer to just add

type domProps = ReactDOM_V3.domProps

to legacy/ReactDOMRe.res.

Good point. I’ll make a PR to fix it.
How about adding the old type props either?

type props = ReactDOM_V3.Props.props

Not sure if it is required, but I guess it won't hurt.

So

type domProps = ReactDOM_V3.Props.domProps
type props = ReactDOM_V3.Props.props

or equivalently, as there is an include Props in ReactDOM_V3:

type domProps = ReactDOM_V3.domProps
type props = ReactDOM_V3.props

I've run some tests, I found the type alias won't work. Only include ReactDOM_V3.Props fixes the issue, because the type alias is not working @derving(abstract). That's why the error msg was complaining about the value of domProps instead of type domProps.

Ah, right, sorry, had not noticed that in the error message.

@cristianoc Can you check whether the issue is gone?

@cristianoc Can you check whether the issue is gone?

Works well, thanks.