Issue getting an input to work

hi, i’m having a problem getting an input to work. i get this error out of the box (using the codegen implementation): “Warning: You provided a value prop to a form field without an onChange handler. This will render a read-only field.”. plasmic is adding the value attribute in its generated code, and this is indeed the result: the input is read-only. however, adding an onChange doesn’t help other than to remove the warning, and handling both the value and onchange also doesn’t work:

  email={{
    props: {
      value: searchProperty.email,
      onChange: (e) => searchProperty.email = e.target.value
    }
  }} 

(this is in a new next.js app)

Hi Spencer - are you using a particular state management framework? I notice you’re directly setting a JS object attribute - unless that’s something like a mobx model, you’ll need to make sure the React component gets re-rendered when updating the state.

For instance, a basic state setup in React would look like:

const [email, setEmail] = useState("");

<input value={email} onChange={e => setEmail(e.target.value)} />

// or with Plasmic:

...
email={{
  props: {
    value: email,
    onChange: e => setEmail(e.target.value)
  }
}}

no, i’m not yet. good point, sounds like maybe i was trying to keep it too basic, i’ll flesh it out a bit further. thanks for your help!