Heres my fetched data and sets the CONNECT isFixed value to true
useEffect(() => {
async function fetched_roles() {
const response = await axios.get("/rmsroles");
let newresponse = response !== null &&
(response.data).map((role) => (
role.role == 'CONNECT' ?
{ value : role.role , label : role.role , isFixed: 'true' }
:
{ value : role.role , label : role.role , isFixed: 'false' }
))
setIsLoading(false);
setRoles(newresponse);
}
fetched_roles();
}, []);
Here's my Select Component
<Select
name="roles"
onChange={handleGetRoles}
isMulti
isLoading={isLoading}
options={roles}
components={animatedComponents}
/>
I don't clearly understand in the documentation in react-select
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)