Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MykolaGolubyev/e9f84ac0edbfc5528fbf960cee20af2b to your computer and use it in GitHub Desktop.
Save MykolaGolubyev/e9f84ac0edbfc5528fbf960cee20af2b to your computer and use it in GitHub Desktop.
import * as React from 'react';
import { Registry, simulateState } from 'react-component-viewer';
import { LabeledCheckBox } from './LabeledCheckBox';
const [getCheckBoxValueA, setCheckBoxValueA] = simulateState(true);
const [getCheckBoxValueB, setCheckBoxValueB] = simulateState(false);
export function labeledCheckBoxDemo(registry: Registry) {
registry
.add('checked', () => (
<LabeledCheckBox
label={label}
value={getCheckBoxValueA()}
onChange={setCheckBoxValueA}
/>
))
.add('unchecked', () => (
<LabeledCheckBox
label={label}
value={getCheckBoxValueB()}
onChange={setCheckBoxValueB}
/>
));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment