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

    ambitious-knife-25690

    01/10/2020, 11:48 PM
    saaaaad
  • a

    ambitious-knife-25690

    01/10/2020, 11:54 PM
    Running react-router-dom version 4.3.1 with git externs
  • a

    ambitious-knife-25690

    01/10/2020, 11:54 PM
    think ima give up for now
  • a

    ambitious-knife-25690

    01/10/2020, 11:59 PM
    Okay defo giving up now, this error is back 😂
  • a

    ambitious-knife-25690

    01/11/2020, 4:00 PM
    The snake oil i've figured out to remove annoying diagnostics error
  • h

    hundreds-dentist-88554

    01/11/2020, 4:06 PM
    is it really snake oil if it works? 😉
  • a

    ambitious-knife-25690

    01/11/2020, 4:09 PM
    WELL, the compiled code still errors so i'm not sure if this is me bypassing diagnostics and there's actually an issue or something else :D
  • a

    ambitious-knife-25690

    01/11/2020, 4:20 PM
    omg I think I got it
  • a

    ambitious-knife-25690

    01/11/2020, 4:20 PM
    And I think it was a stoopid simple fix.
  • a

    ambitious-knife-25690

    01/11/2020, 4:40 PM
    Can confirm diagnostics snake oil is indeed legit
  • a

    ambitious-knife-25690

    01/11/2020, 4:40 PM
    I've got react router working \o/
  • a

    ambitious-knife-25690

    01/11/2020, 4:41 PM
    Funnily enough to be able to get the diagnostics to go away I can only switch to
    Route.hx
  • a

    ambitious-knife-25690

    01/11/2020, 4:41 PM
    any other file doesn't work
  • a

    ambitious-knife-25690

    01/11/2020, 4:41 PM
    legit
  • a

    ambitious-knife-25690

    01/11/2020, 4:50 PM
    Okay i've also figured out a way to bypass dumb snake oil technique
  • a

    ambitious-knife-25690

    01/11/2020, 4:51 PM
    it works like normal now
  • a

    ambitious-knife-25690

    01/11/2020, 4:51 PM
    wooo \o/
  • a

    ambitious-knife-25690

    01/11/2020, 6:07 PM
    @User mui is missing
    TableContainer
    I would add it but I have no idea how to structure the externs with this 😂
  • u

    user

    01/13/2020, 8:39 AM
    Sorry I wasn't available this week-end, are all react-router issues solved?
  • u

    user

    01/13/2020, 8:40 AM
    Yeah TableContainer is 4.8.0, externs are available for 4.7.2 only atm
  • u

    user

    01/13/2020, 8:41 AM
    I'll try to catch up this week :)
  • u

    user

    01/13/2020, 10:56 AM
    > Either way, is the proper way to utilise
    wrap
    by adding
    @:wrap(react.router.ReactRouter.withRouter)
    to the Component and then adding
    history
    as prop? Usually I do this:
    Copy code
    import react.router.ReactRouter;
    import react.router.Route.RouteRenderProps;
    
    private typedef Props = {
        > PublicProps,
        > RouteRenderProps,
    }
    
    private typedef PublicProps = {
        // ...
    }
    
    @:publicProps(PublicProps)
    @:wrap(ReactRouter.withRouter)
    class MyComponent extends ReactComponentOfProps<Props> { /* ... */ }
  • u

    user

    01/13/2020, 10:58 AM
    Did you get
    You should not use <Route> or withRouter() outside a <Router>
    because you were missing a router?
  • u

    user

    01/13/2020, 11:03 AM
    Damn I can't find v4 doc, seems to have changed somehow in v5
  • u

    user

    01/13/2020, 11:12 AM
    I don't have this issue because for things like that I usually do
    <Route component={SystemLogs} ... />
    Anyway, this should work with latest react-router-4 git
  • a

    ambitious-knife-25690

    01/13/2020, 3:20 PM
    Yeah it was a really dumb issue
  • a

    ambitious-knife-25690

    01/13/2020, 3:21 PM
    I didn't wrap the ReactDom call to
    <$App>
    in a router
  • a

    ambitious-knife-25690

    01/13/2020, 3:22 PM
    I had only wrapped the App component specifically
  • a

    ambitious-knife-25690

    01/13/2020, 3:23 PM
    I figured that out by checking the other react router libs readme
  • a

    ambitious-knife-25690

    01/13/2020, 3:25 PM
    And the way I got past that weird diagnostics issue was just provide it with the component prop rather than making it a child
1...282930...80Latest