I am trying to manage a checkbox with react. The following code works well enough, but I want to refactor out the code in the render method so that it uses a Component. I want
Use createRef to create the ref that you end up passing down.
If you're passing a ref to a function component use React.forwardRef.
If you're passing a ref down to a class component ensure that the prop name is anything except ref or you'll get a special prop warning.
ref