tbg_props_to_state

2.0.0 • Public • Published

Props to State

How to use

Comp   = React.createClass

  getInitialState: -> 
    TransferToState(@props, 
      current_user: "options.current_user?",
      verification_status: "options.verification_status"
    )

If you also wish to set default state values

Comp   = React.createClass

  getInitialState: -> 
    TransferToState(@props,
      {
        current_user: "options.current_user?",
        verification_status: "options.verification_status"
      },
      {
        display: true
      }
    )

/tbg_props_to_state/

    Package Sidebar

    Install

    npm i tbg_props_to_state

    Weekly Downloads

    2

    Version

    2.0.0

    License

    MIT

    Last publish

    Collaborators

    • samternent
    • adtaylor