Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Can't pass ref anymore? #67

@Maclay74

Description

@Maclay74

For some reason I can't retrive ref from the carousel:

<TinySlider {...props} ref={ref => console.log(ref)} />

I get error saying that there is no such prop.
In @types/tiny-slider-reader I don't see any ref prop available too.

If I ignore this, I get this error in browser:

Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

And if I pass it like

<TinySlider {...props} forwardedRef={ref => console.log(ref)} />

I get a reference to html element, not tiny-slider. And then application falls with error that children.length is undefined.

What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions