I am a "react-bootstrap with hooks" first-timer and I am creating a simple form. I am following the react-bootstrap documentation's example and I am running into a problem with select/option form elements. Regular text input fields render normally without an error. Select statements seem to blow things up.
Here is my code:
import { Form, Button } from "react-bootstrap";
export default function FormComponentName(props) {
return (
<>
<h1>Search Form</h1>
<Form>
<Form.Group className="mb-3" controlId="searchState">
<Form.Label>State</Form.Label>
<Form.Select defaultValue="State...">
<option>State...</option>
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</Form.Select>
</Form.Group>
<Button variant="primary" type="submit">
Search Data
</Button>
</Form>
</>
)
}
Here is the yarn error message:
Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check the render method of `FormComponentName`.
And from the console:
index.js:1 Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check your code at FormComponentName.js:14.
at FormComponentName
Do I need to install an additional module, or is it something more obvious?