0.2.0 • Published 7 years ago

create-react-organism v0.2.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

create-react-organism

Easily create react-organism smart components.

Usage

yarn create react-organism CustomName

# or

npm i -g create-react-organism
create-react-organism CustomName

Creates an organisms directory in your project, and a directory for your organism inside there: /src/organisms/CustomName/

Three files are created inside:

  • CustomName.js: a pure React component that renders the given state as props, as well as call action handlers defined in state.js
  • state.js: a list of exported functions that handle the progression of state, from its initial form, to load data in asynchronously, to other action handlers that are called in response to events (e.g. onClick, onChange, etc).
  • index.js: connects the pure component and state together and exports it for easy use.

To use the organism, simply import it:

// pages/example.js
import CustomName from '../organisms/CustomName'

export default () => (
    <div>
        <CustomName prop1='one' />
    </div>
)
0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago