How to make a fixed options in react select i dont seem to understand their documentation on how the thing work
Here's what i wanted in react-select
This is my form with react select i want to fix the CONNECT option i also set the isFixed to false except for the CONNECT options
Here's my Code
This is my fetched data i also set the isFixed value to false except in CONNECT
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();
}, []);
This is the react-select component
<Select
name="roles"
onChange={handleGetRoles}
isMulti
isLoading={isLoading}
options={roles}
components={animatedComponents}
/>