React-Select Package | React Tutorial
Create a Simple Select Option with React-Select Functional Component.
May 30, 2023
import React from "react";
import Select from "react-select";const options = [Get Revive Coding’s stories in your inbox
Join Medium for free to get updates from this writer.
{ value: "book", label: "book" },
{ value: "cycle", label: "cycle" },
{ value: "apple", label: "apple" }
];function App() {
const [selectOption, setSelectOption] = React.useState(null);
return (
<React.Fragment>
<Select
defaultInputValue={selectOption}
onChange={setSelectOption}
options={options}
/>
</React.Fragment>
);
}export default App;






