akiran / akiran/react-slick

Use forwardRef to pass the ref up the component tree

Aperta
#1,690 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
11.9k
Fork
2.1k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I'm currently trying to expose slick to my component so I can use `.slick('resize')`.

However, the ref seems to return the ReactSlick instance itself and that doesn't seem to contain a ref to the slick instance.

React has a newish feature called [forwardRef](https://reactjs.org/docs/forwarding-refs.html) which enables a component to forward the ref down to the base component/node. Would be really useful to have this and expose the slick instance right the way up the tree.

Alternatively, does anyone know a way of exposing the slick instance or triggering the resize event?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.