Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation: Duplicate useState in HeadlessSidebar Demo Full Code Example #6033

Closed
melloware opened this issue Feb 22, 2024 · 0 comments · Fixed by #6034
Closed

Documentation: Duplicate useState in HeadlessSidebar Demo Full Code Example #6033

melloware opened this issue Feb 22, 2024 · 0 comments · Fixed by #6034
Assignees
Labels
Component: Documentation Issue or pull request is related to Documentation
Milestone

Comments

@melloware
Copy link
Member

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 melloware transferred this issue from primefaces/community Feb 22, 2024
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 22, 2024
@melloware melloware added Component: Documentation Issue or pull request is related to Documentation and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Feb 22, 2024
melloware added a commit to melloware/primereact that referenced this issue Feb 22, 2024
@melloware melloware self-assigned this Feb 22, 2024
@melloware melloware added this to the 10.5.2 milestone Feb 22, 2024
nitrogenous added a commit that referenced this issue Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Issue or pull request is related to Documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant