react-server-native
v0.0.6
Published
An Starter Server Side Rendering (SSR) React app powered by React-Server, Redux and React Native
Downloads
7
Readme
React Server Redux Starter
An Starter Server Side Rendering (SSR) React app powered by React-Server, React-Router, Redux and React Native
Quick Start
Install npm dependencies:
npm install
Start react-server in development mode:
npm start
In a seperate shell, open app in browser:
npm run open
Description
In counter-app/index.js, the Redux store is initialized by passing a reducing function into
createStore()
.The store is passed into the react-redux's
<Provider />
component. This makes the Redux store available to theconnect()
calls in the component hierarchy below.The
connect()
is used in the<Counter />
component which gives the component access to the Redux store.The
store.dispatch()
functions are passed down as props in the<Counter />
component. These are used to dispatch increment & decrement actions, which mutate the Redux store.
Note: Single Redux store lives in pages/store.js. In a larger application, you can combine multiple reducers from multiple pages with combinedReducer()
to instantiate a single Redux store.