The onChange callback isn't firing when the user chooses a different select option. I'm using react-bootstrap as my FE component library. I've tried structuring the callback differently (ex. as a string etc.) but haven't had any luck. Thanks in advance!
JSX:
<Form.Group as={Col} hidden={!showSegments} controlId={segmentId} className="required">
<p>I am teaching in this space:</p>
<select ref={segmentSelect} name="segmentId" onChange={toggleSchoolBoardVisibility}>
{ segments.map((x) => (
<option value={x.segmentId}>{x.name}</option>
)
)) }
</select>
</Form.Group>
JAVASCRIPT:
const toggleSchoolBoardVisibility = () => {
console.log('hi')
}
EDIT: The onChange function is located in the same component. If I replace onChange with onBlur or onFocus, the callback gets called and works as expected.