| 1 | const FooContext = React.createContext({current: null}); |
| 2 | |
| 3 | function Component(props) { |
| 4 | const foo = React.useContext(FooContext); |
| 5 | const ref = React.useRef(); |
| 6 | const [x, setX] = React.useState(false); |
| 7 | const onClick = () => { |
| 8 | setX(true); |
| 9 | ref.current = true; |
| 10 | }; |
| 11 | return <div onClick={onClick}>{React.cloneElement(props.children)}</div>; |
| 12 | } |
| 13 | |
| 14 | export const FIXTURE_ENTRYPOINT = { |
| 15 | fn: Component, |
| 16 | params: [{children: <div>Hello</div>}], |
| 17 | }; |