MCPcopy
hub / github.com/preactjs/preact / Component

Function Component

hooks/test/browser/useId.test.jsx:163–198  ·  view source on GitHub ↗
({ showStateful = false })

Source from the content-addressed store, hash-verified

161 };
162
163 const Component = ({ showStateful = false }) => {
164 const rootId = useId();
165 const paragraphId = useId();
166
167 return (
168 <main>
169 ID: {rootId}
170 <p>Hello world id: {paragraphId}</p>
171 {showStateful ? (
172 <Stateful />
173 ) : (
174 <ChildReturn>
175 <SomeMessage msg="child-return" />
176 <ChildReturn>
177 <SomeMessage msg="child-return" />
178 <ChildReturn>
179 <SomeMessage msg="child-return" />
180 </ChildReturn>
181 </ChildReturn>
182 </ChildReturn>
183 )}
184 <ChildFragmentReturn>
185 <SomeMessage msg="child-fragment-return" />
186 <SomeMessage msg="child-fragment-return-2" />
187 <SomeMessage msg="child-fragment-return-3" />
188 <SomeMessage msg="child-fragment-return-4" />
189 <ChildReturn>
190 <SomeMessage msg="child-return" />
191 <ChildFragmentReturn>
192 <SomeMessage msg="child-fragment-return" />
193 </ChildFragmentReturn>
194 </ChildReturn>
195 </ChildFragmentReturn>
196 </main>
197 );
198 };
199
200 const rtsOutput = rts(<Component />);
201 render(<Component />, scratch);

Callers

nothing calls this directly

Calls 1

useIdFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…