Hello,
I’m giving a try to Rescript (and by the was I was really confused between ReasonML & Rescript) and so I’m using it in a create-react-app project.
I have some habits from my JS background and especially I really don’t like the default export. So as soon as I create a React Component I choose to export it explicitly
And now I was trying to rewrite the default App.js to a default App.res file but I can’t really get my way out of this.
It seems that if I don’t write it with the make
convention (which is kind of weird from my perspective) it doesn’t even compile.
FAILED: src/App.ast
Fatal error: exception Invalid_argument(“react.component calls cannot be destructured.”)
And If I use the make convention, I have to deal with the really weird and disturbing (again from my perspective) convention to import it this way:
import { make as App } from “./App.bs.js”
Where I want to write it like this:
import { App } from “./App.bs.js”
So… question would be: is it possible simply?
And what happen if I have several react components from the same file?