3 Matching Annotations
- Dec 2021
-
svelte.dev svelte.dev
-
A Map of root-level context key-value pairs to supply to the component
-
- Nov 2019
-
stackoverflow.com stackoverflow.com
-
const setRefs = useRef(new Map()).current; const { children } = props; return ( <div> {React.Children.map(children, child => { return React.cloneElement(child, { // v not innerRef ref: node => { console.log('imHere'); return !node ? setRefs.delete(child.key) : setRefs.set(child.key, node)
Illustrates the importance of having unique keys when iterating over children, since that allows them to be used as unique keys in a Map.
-
- Jul 2018
-
www.hacksparrow.com www.hacksparrow.com
-