Skip to content

how to use ref in function component  #386

@gitdogogo

Description

@gitdogogo

const fn= ({}: Props) => {
let _drawer = React.useRef();
function close() {
_drawer.current.close();
}
function open() {
_drawer.current.open();
}
return (
<Drawer
styles={drawerStyles}
ref={(ref) => (_drawer.current = ref)}
drawerType="overlay"
openDrawerOffset={0.5}
acceptTap={true}
open={true}
content={}
>


);
};

when i used like this , but it's not worked

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions