Hi everyone I am having an issue with the react-select onBlur function, I did a lot of research and looked into relevant git issues but still couldn't find an answer. OnBlur function does not get the selected values, the value in onBlur is shown undefined. if the answer available please suggest me. Thanks for the help
Codesanbox Link for reference:
import React, { useState } from "react";
import Select from "react-select";
import "./styles.css";
export default function App() {
const [value, setValue] = useState();
const options = [
{
label: "first option",
value: 1
},
{
label: "second option",
value: 2
},
{
label: "third option",
value: 3
}
];
const onSelect = (value) => {
setValue(value);
};
const onBlurValue = (value) => {
console.log(value);
};
return (
<div>
<Select
value={options.label}
options={options}
onChange={onSelect}
blurInputOnSelect
onBlur={onBlurValue}
/>
</div>
);
}