Need to create a checkbox component in React which puts tick mark on first check, turns it to cross mark on next click and then to blank on next consecutive click. How can I do that ? Below is my checkbox component:-
function getStyles(info) {
var style = {};
style.position = 'absolute';
style.width = '16px';
style.height = '16px';
style.margin = '4px 0 0';
style.background = '#EEE';
style.display = info.display;
return style;
}
const CheckboxValue = ({value, style}) => (
<input type="checkbox" style={style} value={value} />
);
export default (props) => {
return (
<CheckboxValue style={getStyles(props)} />
);
}