Giter VIP home page Giter VIP logo

Comments (4)

explorigin avatar explorigin commented on May 14, 2024 3

Got it sorted. If you want this to be part of the final API, I did it like this: v2.0...twistle:v2.0

My register wrapper function ends up looking like:

function registerWrappedComponent(screenID, generator) {
    const generatorWrapper = () => {
        const InternalComponent = generator();
        return class extends Screen {
            static navigatorStyle = InternalComponent.navigatorStyle || {};
            static navigatorButtons = InternalComponent.navigatorButtons || {};
            constructor(props) {
                super(props);

                this.allProps = {
                    ...props,
                    ...PropRegistry.load(props.screenInstanceID),
                };
            }

            render() {
                return (
                    <SuperProvider store={store} i18n={i18n}>
                        <InternalComponent navigator={this.navigator} {...this.allProps} />
                    </SuperProvider>
                );
            }
        };
    };
    Navigation.registerScreen(screenID, generatorWrapper);
    return generatorWrapper;
}

from react-native-navigation.

DanielZlotin avatar DanielZlotin commented on May 14, 2024 2

I agree @smooJitter . I think changing the API to require a factory method instead of a screenID would be better, and MUCH more flexible (instead me creating the Screen, you create it for me - the way you want).

from react-native-navigation.

explorigin avatar explorigin commented on May 14, 2024

I'm working through this. Merely exposing it is not good enough. Currently getting a message:

Super expression must either be null or a function, not undefined.

from react-native-navigation.

smooJitter avatar smooJitter commented on May 14, 2024

I'm anticipating the same problem. In addition to the language api, I'm going with.
.

I've always thought tucking away redux provider was constraining.

I plan to use your solution. Thanks.

Neverless, perhaps there should be a way to configure the redux provider without tampering with package files. I'm not sure how that will work

from react-native-navigation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.