It's basically a simplified & scoped convenient wrapper for react-redux's connect.
It behaves identical to withData, but provides form state rather than form data.


  1. mapStateToProps (Function?): A function that maps the form state to the component props. It has the signature (state, ownProps) => Object. By default it passes the whole form data as the data prop. ownProps refers to the props passed to the enhanced component itself.


(Function) HoC that is used to apply the state mapping


import React from 'react'
import { withState } from 'react-controlled-form'

function Warning({ accepted_terms }) {
  if (accepted_terms) {
    return null

  return (
      "You must accept our terms of trade in order to proceed."

const mapStateToProps = ({ accepted_terms }) => ({

export default withState(mapStateToProps)(Warning)

results matching ""

    No results matching ""