This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {useCurrentLocale, LocaleSwitcher} from 'reusable-locale'; | |
const Comp1 = () => { | |
const currentLocale = useCurrentLocale(); // Using a global store from external lib | |
} | |
const Comp2 = () => { | |
return <LocaleSwitcher/>; // External components using the same global store | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const VirtualScroll = ({ | |
renderItem, | |
itemCount, | |
viewportHeight, | |
rowHeight, | |
nodePadding, | |
}) => { | |
const totalContentHeight = itemCount * rowHeight; | |
let startNode = Math.floor(scrollTop / rowHeight) - nodePadding; |
OlderNewer