I'm testing this library, but i can't make it work properly, when i try to click on an element in the popup, it doesn't select the element, i'm using it as following:
import React from 'react';
import Modeler from '../containers/modeler/modeler';
import ModelerForm from '../containers/modeler/modeler-form';
import Select from 'react-select';
var options = [
{value: '7fjJFCc2ehdm4SBBPIqPwT', label: 'Admins'},
{value: '4RAk1ZzzZsnbk5VlDQeSVy', label: 'Nurses'}
];
export default function ProcessNew({params}){
return (
<div>
<Select
name="select-group"
onChange={(n, s) => console.log(n,s)}
options={options}
/>
<Modeler processId={params.processId} />
<ModelerForm />
</div>
);
}
My bad, this is a Controlled component.
Even I'm facing the same issue :/ what to do ?
@varun-raj this is a controlled component, so i have to create an state and pass it as value and a onChange properties to the component itself.
<Select
labelKey="name"
name="field-name"
onChange={(newValue) => selectElementParticipants(newValue)}
options={participants}
isLoading={isFetching}
disabled={isFetching}
searchable={false}
valueKey="id"
value={this.state.participants}
Most helpful comment
@varun-raj this is a controlled component, so i have to create an state and pass it as value and a onChange properties to the component itself.