Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

Runtime Component Exception - Element type is invalid #8

Closed
cambiata opened this issue Dec 17, 2020 · 3 comments
Closed

Runtime Component Exception - Element type is invalid #8

cambiata opened this issue Dec 17, 2020 · 3 comments

Comments

@cambiata
Copy link

Thank you, Thomas, for this repo! Seems to be a good way of combinig haxe and react-native workflows.

When running the Haxe-compiled app, I get the following: "Component Exception - Element type is invalid: expected a string (for built-in components) or a class/function...

exception

I'm on Andriod studio: 4.1.1, react-native-cli: 2.0.1, react-native: 0.56.0
Compiled with Haxe 4.1.4

Maybe something related to this:
https://stackoverflow.com/questions/34130539/uncaught-error-invariant-violation-element-type-is-invalid-expected-a-string

Ideas?

/ Jonas

@cambiata
Copy link
Author

Hello again! It seems to be a problem with haxe js scoping and exporting.
I get it to work by using

-D js-es=6
-D js-classic

and after compile replacing $hx_exports["App"] = App; with export default App;
(Maybe it's a problem just with latest something..? react-native: 0.56.0? react-native-cli: 2.0.1?)

With the solution I can go on exploring Haxe & R-N! :-)

@zabojad
Copy link
Owner

zabojad commented Dec 18, 2020

Hey @cambiata ! Thank you for your interest. I will be honest, I interrupted the work on this repo quite some time ago because of lack of interest by anyone else I talked about it to.

Anyway, if you think it can be useful, I might give it some time to get it right. Right now it is obsolete as it is Haxe 3 and an old version of the haxe-react-native lib...

The error "Component Exception - Element type is invalid: expected a string (for built-in components) or a class/function... means you are trying to render something which is neither a String nor a React component...

Can you please share your code here so that I check what's wrong?

@cambiata
Copy link
Author

Hello again, Thomas, and sorry for late answer!

No problem with your code - to my newly found understanding. I was expecting Haxe to produce an App.js fully compatible with the default App.js producued by react-native init ..., but obviously it isn't... There are some initiatives to solve this:
HaxeFoundation/haxe#10003

I'm closing this now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants