https://linen.dev logo
Join Discord
Powered by
# react
  • u

    user

    12/17/2020, 9:53 PM
    You might find him on gitter
  • u

    user

    12/17/2020, 9:54 PM
    He's still using that stack afaik, and starts new projects regularily
  • u

    user

    12/17/2020, 9:54 PM
    He should have a working base somewhere
  • w

    wide-greece-63479

    12/17/2020, 9:54 PM
    Yep. I've filed an issue also.
  • c

    cool-psychiatrist-49311

    12/18/2020, 11:43 AM
    The app registration code is in the bin folder, in native js
  • w

    wide-greece-63479

    12/18/2020, 12:03 PM
    Yes, but it seems that
    $hx_exports["App"] = App;
    isn't "good enough" - at least not for for react-native-cli version 2.0.1.
  • w

    wide-greece-63479

    12/18/2020, 12:04 PM
    If i use
    -D js-classic
  • w

    wide-greece-63479

    12/18/2020, 12:04 PM
    and add the line
    export default App;
    to the compiled App.js output,
  • w

    wide-greece-63479

    12/18/2020, 12:04 PM
    it works.
  • c

    cool-psychiatrist-49311

    12/18/2020, 12:24 PM
    Why is that related to RN version? It is just typical js export
  • w

    wide-greece-63479

    12/18/2020, 1:17 PM
    Just a uninformed guess - I just try to understand why all Haxe React Native demos (including your haxe-react-native-sample) require me to use
    -D js-classic
    and manually adding that
    export default App;
    line... 🙂
  • c

    cool-psychiatrist-49311

    12/18/2020, 1:18 PM
    I never need to do that
  • c

    cool-psychiatrist-49311

    12/18/2020, 1:18 PM
    I don't even know there is such a define 😅
  • w

    wide-greece-63479

    12/18/2020, 1:20 PM
    Strange...
    -D js-classic
    It just eliminates the function wrapper of the haxe-generated code.
  • w

    wide-greece-63479

    12/18/2020, 1:23 PM
    Without it, I can't use
    export default App
    - and without that I get the "Component Exception - Element type is invalid" runtime error... 🥴
  • c

    cool-psychiatrist-49311

    12/18/2020, 1:24 PM
    How did you import it?
  • c

    cool-psychiatrist-49311

    12/18/2020, 1:25 PM
    Haxe doesn't export default, but named
  • w

    wide-greece-63479

    12/18/2020, 1:25 PM
    I just replace the App.js generated from a standard
    react-native init whatever
    command.
  • c

    cool-psychiatrist-49311

    12/18/2020, 1:25 PM
    So you need to import it as named import
  • w

    wide-greece-63479

    12/18/2020, 1:27 PM
    Aha. Where do I define that?
  • c

    cool-psychiatrist-49311

    12/19/2020, 2:26 AM
    You can check out the RN example repo above
  • c

    cool-psychiatrist-49311

    12/19/2020, 2:27 AM
    Basically it is
    import {App} from ...
  • w

    wide-greece-63479

    12/19/2020, 9:02 AM
    Ah, I see. You have that extra index.target.js-file that imports the Haxe generated script.
  • w

    wide-greece-63479

    12/19/2020, 9:03 AM
    Ok, that basically does the same thing as my solution - adds the "glue" needed for react-native consume the Haxe generated code.
  • w

    wide-greece-63479

    12/19/2020, 9:04 AM
    I was hoping that this wouldn't be needed. (No big deal of course.)
  • w

    wide-greece-63479

    12/19/2020, 10:09 AM
    Let's hope this es6 export issue will be adressed soon: https://github.com/HaxeFoundation/haxe/issues/8033
  • u

    user

    12/19/2020, 10:24 AM
    It's in the backlog so unless someone (other than simn/alex) starts working on it, it won't be implemented "soon" =/
  • u

    user

    12/19/2020, 10:30 AM
    Hmm it doesn't look like much at all actually
  • u

    user

    12/19/2020, 10:33 AM
    https://github.com/HaxeFoundation/haxe/pull/10003 🤞
  • u

    user

    12/19/2020, 10:39 AM
    So that'd work with
    -D js-classic
    only, right?
1...565758...80Latest