Open electic opened 6 years ago
Try using quotes for attribute values
Il mar 10 apr 2018, 14:44 Raj Kadam notifications@github.com ha scritto:
Hi,
I am new to react-templates. How would I put something like this in a template:
<Select name="form-field-name" value={value} onChange={this.handleChange} options={[ { value: 'one', label: 'One' }, { value: 'two', label: 'Two' }, ]} />
When I put this in, it throws an error. Any help appreciated!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wix/react-templates/issues/237, or mute the thread https://github.com/notifications/unsubscribe-auth/ACemK7T5dnzLMiuDbXWAAWxtwp7k4-elks5tnKlLgaJpZM4TOLu8 .
I tried that. Here is the component I am trying to use:
the following
<Select
name="form-field-name"
value="{value}"
onChange="{this.handleChange}"
options="{[ { value: 'one', label: 'One' }, { value: 'two', label: 'Two' }, ]}"
/>
did produce a perfectly valid output in React templates playground.
What error message are you getting?
Hi,
I am new to react-templates. How would I put something like this in a template:
<Select name="form-field-name" value={value} onChange={this.handleChange} options={[ { value: 'one', label: 'One' }, { value: 'two', label: 'Two' }, ]} />
When I put this in, it throws an error. Any help appreciated!