New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(react-context): add @almin/react-context #346

Merged
merged 7 commits into from Jun 8, 2018

Conversation

Projects
None yet
1 participant
@azu
Member

azu commented Jun 7, 2018

createReactContext create thee React Context from Almin's Context instance.

const testStore = createTestStore({
    value: "initial"
});
const context = new Context({
    store: testStore
});
const { Consumer, Provider } = createReactContext(context);

class App extends React.Component {
    render() {
        return (
            <Provider>
                <Consumer>
                    {state => {
                        return <p>{state.value}</p>;
                    }}
                </Consumer>
            </Provider>
        );
    }
}

fix #112

@azu azu referenced this pull request Jun 8, 2018

Closed

@almin/store-test-helper #347

@azu azu referenced this pull request Jun 8, 2018

Closed

Almin 0.17 #345

@azu azu merged commit 287c72f into master Jun 8, 2018

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details

@azu azu deleted the react-render-props branch Jun 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment