Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Axel Huizinga
    @axelhuizinga
    From the docs: React has a powerful composition model, and we recommend using composition instead of inheritance to reuse code between components.
    So it's not forbidden :)
    Rudy Ges
    @kLabz
    You can add -D react_skip_extend_component_restriction then
    It's still not recommended in reactjs and the behavior is not defined in haxe-react (well mostly in react-next)
    It might not work any more in the future
    Axel Huizinga
    @axelhuizinga
    Looking at the docs a little more at least revealed how I can avoid this pattern and still provide shared functions in an extra module
    Axel Huizinga
    @axelhuizinga
        override public function render()
        {
            return jsx('
                <Tabs className="is-centered" >                
                    ${buildNav()}
                </Tabs>        
            ');
        }        
    
        function buildNav()
        {
            var userState = App.store.getState().userState;
            //trace(userState);
            if (userState.waiting || userState.dbUser.id == 0|| userState.dbUser.jwt == null || userState.dbUser.jwt == '')
            {
                // WE REQUIRE TO LOGIN FIRST
                return null;
            }
            else        
            return jsx('
            <>
                <$TabLink to="/DashBoard" ${...props}>DashBoard</$TabLink> 
                <$TabLink to="/Data" ${...props}>Daten</$TabLink>            
                <$TabLink to="/Accounting" ${...props}>Buchhaltung</$TabLink>
                <$TabLink to="/Reports" ${...props}>Berichte</$TabLink>
                <i className = "icon abs-right fa fa-sign-out"  title = "Abmelden"  onClick=${logOut}
                style={{margin:".8rem .5rem",fontSize:"1.7rem", cursor:"pointer", color:"#801111"}}></i>
            </>
            ');
        }
    this compiles and runs well but recently I get this diagnostic warning at the ${buildNav()} in the render function
    Incompatible class for ReactType: expected a ReactComponent or a @:jsxStatic component
    How can I solve this
    Rudy Ges
    @kLabz
    Diagnostics give false warnings sometimes
    Maybe typing buildNav explicitly as ReactFragment would help
    Axel Huizinga
    @axelhuizinga
    nope - I'll ignore it - can you tell me what's wrong here: while using some tab links with a Location as to prop trying to access it fails with
    haxe.extern.EitherType<String, history.Location> has no field pathname
    (doesn't compile) but should since history.Location has a pathname
    Juraj Kirchheim
    @back2dos
    but what if it's a String?
    Axel Huizinga
    @axelhuizinga
    I access it this way: (4now fixed with untyped) var toCheck:String = (Type.typeof(props.to)==TObject?untyped props.to.pathname:props.to);
    Axel Huizinga
    @axelhuizinga

    in my new app with this as root element:

                <$Provider store={store}>
                    <$DrawingMap userState=${state.userState}/>
                </$Provider>

    I can't find why I get the following error:
    Error: Could not find "store" in the context of "Connect(DrawingMap)". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(DrawingMap) in connect options. connectAdvanced.js:245

    Rudy Ges
    @kLabz
    Wrong reduxjs version
    Should be downgraded to uh something below 7 iirc
    React-redux version *
    Axel Huizinga
    @axelhuizinga
    ah - ok - thx
    Axel Huizinga
    @axelhuizinga
    6.0.1 gave me the same error but 5.1.1 works
    Rudy Ges
    @kLabz
    Does anyone work with external jsx files + ReactMacro.jsx?
    Juraj Kirchheim
    @back2dos
    what's that? ^^
    via the imports handled in tink_hxx?
    anyway ... I have a question regarding react/react-next and Haxe 3 ... I would like to switch to Haxe 4 for a whole number of reasons ^^
    Juraj Kirchheim
    @back2dos
    with react-next using part of tink, I could keep those libs Haxe 3 compatible ... my question would be: is it worth it?
    I see that react-next still supports haxe 3.4.4 (at least CI-wise)
    so I'm kinda wondering whether 1) there are plans to bring the projects back together and 2) how much each of you holds on to Haxe 3?
    Emugel
    @emugel
    Personally even tho I can be quite conservative I don’t hold to haxe 3, because haxe 4 works better than anticipated (and no painful migration).
    Rudy Ges
    @kLabz
    My view on this is as long as it's not too much trouble I might as well keep supporting haxe 3
    If you have good reasons to drop it, then I guess I'd be happy to have an excuse to stop worrying about it x)
    I'm not even sure anyone is using react-next with haxe < 4
    Thomas Fétiveau
    @zabojad
    I am :p
    Axel Huizinga
    @axelhuizinga
    Is there any example of server side rendering react with haxe?
    Philippe
    @elsassph
    I had started a sample project but it's tricky: you need to have a node server and there's a million options.
    Axel Huizinga
    @axelhuizinga

    Recently I see this kind of warnings - do we have to change the function names in ReactComponent.hx?
    Warning: componentWillUpdate has been renamed, and is not recommended for use. See https://fb.me/react-async-component-lifecycle-hooks for details.

    • Move data fetching code or side effects to componentDidUpdate.
    • Rename componentWillUpdate to UNSAFEcomponentWillUpdate to suppress this warning in non-strict mode. In React 17.x, only the UNSAFE name will work. To rename all deprecated lifecycles to their new names, you can run npx react-codemod rename-unsafe-lifecycles in your project source folder.

    Please update the following components: Connect(UiView)

    Vladimir Cores
    @dqvsra_twitter
    Hey! Whats up people? : )
    Axel Huizinga
    @axelhuizinga

    Help - 2 days now looking for the reason of this error (code has been working well b4 but can't find what changed)

    view/dashboard/Settings.hx:componentDidCatch:40:TypeError: _this is undefined Out.hx:156
    view/dashboard/Settings.hx:componentDidCatch:41:{
    componentStack :
    in User (created by Settings)
    in Settings (created by Route)
    ...

    How can I locate the _this reported to be undefined?

    Rudy Ges
    @kLabz
    Running on haxe nightlies? What's in Out.hx:156?
    Axel Huizinga
    @axelhuizinga

    Running on haxe nightlies? What's in Out.hx:156?

    something completely unrelated within an #elseif flash codeblock on a js target... I guess some error in my jsx code caused the weird issue - anyway ok now again

    Axel Huizinga
    @axelhuizinga

    I had started a sample project but it's tricky: you need to have a node server and there's a million options.

    Philippe is your project code still available?

    Axel Huizinga
    @axelhuizinga
    Is there any docs or example for using haxe-apollo?
    Rudy Ges
    @kLabz
    Nope.. I could add some code snippets as "doc"
    1 reply
    Axel Huizinga
    @axelhuizinga
    will be very much appreciated :) any plans about apollo server?
    Rudy Ges
    @kLabz
    None, I don't even know what it does
    Axel Huizinga
    @axelhuizinga
    From their site: Apollo Server is an open-source, spec-compliant GraphQL server that's compatible with any GraphQL client, including Apollo Client. It's the best way to build a production-ready, self-documenting GraphQL API that can use data from any source
    Rudy Ges
    @kLabz
    Well yeah, no plan at all, I'm using dotnet for the API side
    Philippe
    @elsassph
    @axelhuizinga sorry missed your question - I realised my WIP still only had the client side, not SSR. It's a rather complex problem to get right TBH.
    Axel Huizinga
    @axelhuizinga
    after upgrading haxe to 4.1.1 my ReactComponent classes fail to compile with:
    Cannot access field or identifier state for writing
    Rudy Ges
    @kLabz
    Seems like you're using state on a component declared as stateless
    I'll double check locally though
    Damn I actually reproduce..
    Rudy Ges
    @kLabz
    Released 1.121 with a "temp" fix, and opened HaxeFoundation/haxe#9552 to look for a real solution
    Now I have another issue on my project, I hope it doesn't affect all react-next projects..
    Rudy Ges
    @kLabz
    acceptsMoreProps, aria-x props, etc. are (temporarily) broken too =/