Functional statefull React components
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
src
.babelrc
.gitignore
.prettierrc
README.md
package-lock.json
package.json
tsconfig.json

README.md

React Instance

functional statefull React components
proof of concept

Install

npm i react-instance

Example

See CodeSandbox.

const Component = instance(({ setState }) => {
  return (props, state) => (
    <button onClick={() => setState({ active: !state.active })}>
      {state.active ? "Deactivate" : "Activate"}
    </button>
  )
})

API

See src/index.js.

Donate

By buying a beer.