-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Initializing a redux store #277
Comments
This is what we do (pardon the flow types):
|
You can also redefine a |
@sapegin that worked great thanks! |
@stinoga Nice! Could you perhaps share how you created this wrapper that made the store available? |
@stinoga Or even send a PR to the FAQ ;-) |
https://github.com/styleguidist/react-styleguidist/blob/master/docs/FAQ.md#how-to-change-the-layout-of-a-style-guide is out of date. It is now: https://github.com/styleguidist/react-styleguidist/blob/master/docs/Cookbook.md#how-to-connect-redux-store. Specifically for adding redux to the store. |
@timurista @sapegin https://github.com/styleguidist/react-styleguidist/blob/master/docs/Cookbook.md#how-to-connect-redux-store no longer exists. Anywhere else you would direct me/us for an example? I'm specifically looking to dispatch actions from a styleguidist README.md example. |
Inside your .md file import and dispatch like this: import { Provider } from 'react-redux'
import * as actions from './redux/actions';
import store from './redux/store'
store.dispatch(actions.showConnection(true)); //your action
(
<Provider store={store}>
<App />
</Provider>
) If you have issues with importing I suggest to change from npm to yarn since styleguidist has some issues with dependencies when installing with npm. |
Are there any good examples of initializing a redux store with styleguidist? Some of my components use a redux store, and I'd like to get one setup with dummy data for the style guide.
The text was updated successfully, but these errors were encountered: