Skip to content

Can't get store from context #193

@marcuswhit

Description

@marcuswhit

My top level component is like so:

ReactDOM.render(
    <div>
        <Provider store={store}>
            <App />
        </Provider>
    </div>,
    document.getElementById('app')
);

And my App component is like so:

@connect(state => state)
export default class App extends React.Component {
    render() {
        return (
            <div className={cx('container')}>
                <Workspace />
                <Blotter />
            </div>
        );
    }
}

I'm not using React Router, and I've ensured that there is only one React instance loaded.

If I break at the top of App.render, this.context has no store on it. However, this._reactInternalInstance._context does have the store attached. Obviously I can grab this, but I'm guessing I shouldn't really use that one.

Why is there no store on this.context? I want to subscribe to certain state changes.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions