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

    numerous-oil-90946

    02/24/2020, 3:02 PM
    Oh great it works thank you 🙂
  • a

    ambitious-knife-25690

    02/24/2020, 4:38 PM
    So I have a callback from a component that has the following layout
  • a

    ambitious-knife-25690

    02/24/2020, 4:39 PM
    Copy code
    haxe
    {
      navigation: {
        navigation: {
          navigation();
          //,,,
        },
        route: {}  
      }
    }
  • a

    ambitious-knife-25690

    02/24/2020, 4:40 PM
    Is there a way I can create a way to just auto go down one level?
  • a

    ambitious-knife-25690

    02/24/2020, 4:41 PM
    It appears like the javascript definition is by defining something like:
    Copy code
    function foo({route, navigation})
    in the callback
  • u

    user

    02/24/2020, 4:41 PM
    while (navigation) goDeeper()
    ?
  • u

    user

    02/24/2020, 4:42 PM
    3 levels already seem almost crazy to me x)
  • u

    user

    02/24/2020, 4:43 PM
    I don't really understand your issue
  • a

    ambitious-knife-25690

    02/24/2020, 4:43 PM
    i'm going by memory
  • a

    ambitious-knife-25690

    02/24/2020, 4:43 PM
    lemme quickly confirm the structure
  • a

    ambitious-knife-25690

    02/24/2020, 5:13 PM
    okay I was misremembering partially
  • a

    ambitious-knife-25690

    02/24/2020, 5:14 PM
    the extern definition is:
    Copy code
    haxe
    typedef Props = {
        navigation: {}
        route: {}  
    }
  • a

    ambitious-knife-25690

    02/24/2020, 5:14 PM
    So I can have a typedef wrap this easy
  • a

    ambitious-knife-25690

    02/24/2020, 5:14 PM
    But is there a trick to separate this into params instead, perhaps?
  • a

    ambitious-knife-25690

    02/24/2020, 5:15 PM
    So instead of needing to
    data.navigation.stuff();
  • a

    ambitious-knife-25690

    02/24/2020, 5:15 PM
    I could have the function just do
    navigation.stuff()
    and
    route.stuff()
    instead
  • a

    ambitious-knife-25690

    02/24/2020, 5:15 PM
    via
    @:native
    or something
  • a

    ambitious-knife-25690

    02/24/2020, 5:17 PM
    So instead of:
    Copy code
    haxe
    function data(props) {
      props.navigation.navigate();
      props.route.pop();
    }
    I could have:
    Copy code
    haxe
    function data(navigation, route) {
      navigation.navigate();
      route.pop();
    }
  • a

    ambitious-knife-25690

    02/24/2020, 5:17 PM
    regular haxe code prob wont allow this but I wonder if there's some extern magic that could
  • c

    cool-psychiatrist-49311

    02/25/2020, 1:15 AM
    You can use tink.Anon.splat
  • c

    cool-psychiatrist-49311

    02/25/2020, 1:17 AM
    https://github.com/haxetink/tink_anon#splat
  • a

    ambitious-knife-25690

    02/25/2020, 1:36 PM
    ooo interesting
  • b

    bitter-family-72722

    02/25/2020, 2:03 PM
    splat is a great name
  • a

    ambitious-knife-25690

    02/25/2020, 2:04 PM
    That was my first thought
  • a

    ambitious-knife-25690

    02/27/2020, 12:23 AM
    how do I reproduce the extern api for react stuff that have things like
    <Stack.Tab />
    this used to be possible with haxe jsx but I can't seem to get it anymore
  • a

    ambitious-knife-25690

    02/27/2020, 12:23 AM
    has things changed with react-next and I basically have to just create a
    StackTab
    component separately?
  • u

    user

    02/27/2020, 8:42 AM
    static var Tab:ReactType;
    in
    Stack
    ?
  • u

    user

    02/27/2020, 8:43 AM
    Oh, you mean calling it.. well
    <Tab />
    or indeed
    <StackTab />
    (but you can just
    import Stack.Tab as StackTab
    for that)
  • c

    cool-psychiatrist-49311

    02/27/2020, 9:40 AM
    static var Tab:ReactType
    won't work with coconut because it won't know the prop types
  • u

    user

    02/27/2020, 9:41 AM
    Does it understand ReactTypeOf ?
1...414243...80Latest