Skip to content

cape-io/redux-field-connect

Repository files navigation

redux-field-connect

These are some react-redux wrappers/containers for the redux-field module. Because redux-field is not always used with React these are split into a dedicated module.

Wrappers

connectInput(Component)

Use this when you want to attach action handlers (onBlur, onChange, onFocus, onInput, onSubmit) and result value to an input field. @see connectInput getFormEvents

Over Simplified Example:

Make sure you send the wrapped input a prefix property.

import { connectInput } from 'redux-field-connect'

function InputEl(props) {
  return <input {...props} />
}
const Input = connectInput(InputEl)

function CoordsInput() {
  return <Input id="coords" prefix="coords" type="text" size="50" />
}

Working Example: code - website.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published