fable-compiler / fable-react

Fable bindings and helpers for React and React Native
MIT License
275 stars 67 forks source link

ReactElementType.create compiles but editor shows error #142

Closed halcwb closed 4 years ago

halcwb commented 5 years ago

When using ReactElementType.create, the editor (VSCode and VS) shows an error because it references the interface type not the module. Fable compiler can compile the code though.

Is this specific to 4.1.3? I see that in later versions the namespacing has been changed.

alfonsogarciacaro commented 5 years ago

Hmm, the React helpers use #if FABLE_COMPILER for conditional compilation to support also SSR on .NET. It seems that we made a mistake in 4.1.3 and the .dll from the Nuget package doesn't include ReactElementType.create. That's why the editor shows an error.

I've been using 5.0.0-alpha so didn't notice the problem. Can you try with 5.0.0-alpha-04? That version still has the "old" namespaces so you should be able to use it without changing your code.

halcwb commented 5 years ago

Using 5.0.0-alpha-04 indeed resolves the problem. I saw that in another project.