We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I wanted to use external jsx for instead of inline, with compiletime macro:
class Main { public static function main() { AppRegistry.registerComponent('TestReactNative', function() return App); } } @:expose('App') class App extends ReactComponent{ function new(props) { super(props); state = { scene: 0 } } override function render() { function goto(i) setState({scene: i}); return switch state.scene { default: jsx(CompileTime.readFile("jsx/Home.jsx")); } } }
Home.jsx:
<WebView source={{uri: 'https://github.com/facebook/react-native'}} style={{marginTop: 20}} > </WebView>
but I got this error when compile:
/usr/local/lib/haxe/std/haxe/macro/ExprTools.hx:289: characters 11-16 : Unsupported expression: { expr => ECall({ expr => EField({ expr => EConst(CIdent(CompileTime)), pos => #pos(src/Main.hx:35: characters 20-31) },interpolateFile), pos => #pos(src/Main.hx:35: characters 20-47) },[{ expr => EConst(CString(jsx/Home.jsx)), pos => #pos(src/Main.hx:35: characters 48-62) }]), pos => #pos(src/Main.hx:35: characters 20-63) } /Volumes/Work/develop/hx/libs/react/git/src/lib/react/ReactMacro.hx:27: characters 19-43 : Called from src/Main.hx:35: characters 16-64 : Called from
How can I use external jsx with RNhaxe, if I can?
thanks
The text was updated successfully, but these errors were encountered:
It's a good idea, but the JSX macro runs before your readFile.
readFile
I encourage you to look into forking haxe-react and patching the JSX macro to support something native like:
override function render() { function goto(i) setState({scene: i}); return switch state.scene { default: jsx("./jsx/Home.jsx"); } }
Sorry, something went wrong.
Duplicate of issue #1
No branches or pull requests
I wanted to use external jsx for instead of inline, with compiletime macro:
Home.jsx:
but I got this error when compile:
How can I use external jsx with RNhaxe, if I can?
thanks
The text was updated successfully, but these errors were encountered: