CodeFactor found an issue: Error: Cannot call impure function during render
Math.random is an impure function. Calling an impure function can produce unstable results that update unpredictably when the component happens to re-render. (https://react.dev/reference/rules/components-and-hooks-must-be-pure#components-and-hooks-must-be-idempotent).
/app/src/components/ui/sidebar.tsx:643:26
641 | // Random width between 50 to 90%.
642 | const width = React.useMemo(() => {
> 643 | return ${Math.floor(Math.random() * 40) + 50}%;
| ^^^^^^^^^^^^^ Cannot call impure function
644 | }, []);
645 |
646 | return (
It's currently on:
src\components\ui\sidebar.tsx:643
Commit a1ea9eb
CodeFactor found an issue: Error: Cannot call impure function during render
Math.randomis an impure function. Calling an impure function can produce unstable results that update unpredictably when the component happens to re-render. (https://react.dev/reference/rules/components-and-hooks-must-be-pure#components-and-hooks-must-be-idempotent)./app/src/components/ui/sidebar.tsx:643:26
641 | // Random width between 50 to 90%.
642 | const width = React.useMemo(() => {
> 643 | return
${Math.floor(Math.random() * 40) + 50}%;| ^^^^^^^^^^^^^ Cannot call impure function
644 | }, []);
645 |
646 | return (
It's currently on:
src\components\ui\sidebar.tsx:643
Commit a1ea9eb