Code:
import { CustomInput } from 'reactstrap'
...
const changeMediaStatus = (e) => { console.log(e)
}
...
<CustomInput type="switch" className="ml-auto mr-1" onChange={(e) =>changeMediaStatus(e)}
/>On the above code, the function that is assigned at "onChange" prop is not working. And also, CustomInput component with onChange prop is not working.
How can I assign a function to onChange event at reactstrap CustomInput compoenent?
31 Answer
Provide id for the CustomInput.
<CustomInput type="switch" className="ml-auto mr-1" onChange={(e) => changeMediaStatus(e)} />