hypernova-react-redux

1.2.0 • Public • Published

hypernova-react-redux

React/Redux (react-redux) bindings for Hypernova.

NPM version Build Status PeerDependency Status DevDependency Status

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.

Install

npm install hypernova-react-redux

Usage

Here's how use use it in your module:

Single connected component

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
);

Multiple connected components

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
);

Todo

  • To handle the multiple of the connected components

Contribution

  1. Fork it ( http://github.com/noriaki/hypernova-react-redux/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Licence

MIT

Author

noriaki

Package Sidebar

Install

npm i hypernova-react-redux

Weekly Downloads

0

Version

1.2.0

License

MIT

Last publish

Collaborators

  • noriaki