primereact icon indicating copy to clipboard operation
primereact copied to clipboard

Documentation: Duplicate useState in HeadlessSidebar Demo Full Code Example

Open melloware opened this issue 1 year ago • 0 comments

Discussed in https://github.com/orgs/primefaces/discussions/1257

Originally posted by DavanaVM February 22, 2024 Hello, in the Code Example for the HeadlessSidebar Demo the [visible, SetVisible] useState is set twice accidentally:

export default function HeadlessDemo() {
    const [visible, setVisible] = useState(false);
    const btnRef1 = useRef(null);
    const btnRef2 = useRef(null);
    const btnRef3 = useRef(null);
    const btnRef4 = useRef(null);
    const [visible, setVisible] = useState(false); // Redeclaration

This issue also appears in the StackBlitz code example

melloware avatar Feb 22 '24 22:02 melloware