MCPcopy Create free account
hub / github.com/RobPruzan/react-scratch / RandomElement

Function RandomElement

src/script.ts:196–210  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194 });
195};
196export const RandomElement = () => {
197 const [random] = React.useState(Math.random());
198 const ref = React.useRef(0);
199
200 React.useEffect(() => {
201 // console.log("mounting!", random);
202 return () => {
203 // console.log("cleanup");
204 };
205 }, []);
206
207 return React.createElement("div", {
208 innerText: random,
209 });
210};
211export const OuterWrapper = () => {
212 const [counter, setCounter] = React.useState(0);
213 const [toggleInner, setToggleInner] = React.useState(true);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected