Closed alfonsogarciacaro closed 2 years ago
@alfonsogarciacaro
A solution could be to make Feliz helpers import
* as React
, but this would require upgrading more things for the users.
If we make the change in Feliz, I think this is will not be a breaking change right? So, users will naturally upgrade to it over time.
Imports may become a bit overcrowded, for example when compiling Feliz docs I get (among other imports): So if there's no issue in the duplicated imports (default
React
and namespace* as react
) we can leave it as is.
I don't think having duplicated is having a real impact. Perhaps, just a bit of overload because JavaScript needs to process 2 imports instead of one.
Ideally, if what I said above about not the transition being not a breaking change it would be ideal to do it. In general, I try to keep the generated JavaScript on par with what native JavaScript use in general.
Published Feliz.CompilerPlugins v2.0.0-prerelease-003 which includes this change, ready to be tested 😄
This injects
import React as "react"
in all files declaring a React component as discussed in #510.Please note this requires the very latest Fable 4 pre-release, still unpublished 😅
@MangelMaxime Imports may become a bit overcrowded, for example when compiling Feliz docs I get (among other imports):
A solution could be to make Feliz helpers import
* as React
, but this would require upgrading more things for the users. So if there's no issue in the duplicated imports (defaultReact
and namespace* as react
) we can leave it as is.