React/Redux (react-redux) bindings for Hypernova.
On the server, wraps the redux connected component in a function to render it to a HTML string given its props.
On the client, calling this function with your component scans the DOM for any server-side rendered instances of it. It then resumes those components using the server-specified props.
npm install hypernova-react-redux
Here's how use use it in your module:
import { renderReactRedux } from 'hypernova-react-redux';
import MyConnectedComponent from './src/MyConnectedComponent.jsx';
import myConfigureStore from './src/MyStore/ConfigureStore.jsx';
export default renderReactRedux(
'MyConnectedComponent.hypernova.js', // this file's name (or really any unique name)
MyConnectedComponent,
myConfigureStore
);
import React from 'react';
import { renderReactRedux } from 'hypernova-react-redux';
import MyConnectedComponentA from './src/MyConnectedComponentA.jsx';
import MyConnectedComponentB from './src/MyConnectedComponentB.jsx';
import myConfigureStore from './src/MyStore/ConfigureStore.jsx';
export default renderReactRedux(
'MyConnectedComponent.hypernova.js', // this file's name (or really any unique name)
<div>
<MyConnectedComponentA />
<MyConnectedComponentB />
</div>,
myConfigureStore
);
- To handle the multiple of the connected components
- Fork it ( http://github.com/noriaki/hypernova-react-redux/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request