Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Feature request: return a ref from useFacetState #111

@xaviervia

Description

@xaviervia

Example:

const [valueFacet, setValue, valueRef] = useFacetState(0)

This would be equivalent to doing

const [valueFacet, setValue] = useFacetState(0)
const valueRef = useFacetRef(valueFacet)

But then there would be no need for useFacetRef do use a useFacetEffect, instead updating the ref could happen in the setter. This would help with performance, and make the type of the ref cleaner (since it can't be NO_VALUE in this case)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions