Is forwardRef going to be implemented ?
- Langage dominant
- JavaScript
- Étoiles
- 11.9k
- Forks
- 2.1k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
Currently using **Next.js** for a project, and I am trying to use the new Dynamic Import with the Slider (react-slick) component to create a separate chunk.
The problem is that I need to forward the ref to be able to use a custom Next & Prev button.
React has a new API to allow that, [forwardRef](https://reactjs.org/docs/forwarding-refs.html#forwarding-refs-to-dom-components)
**Steps to replicate :**
1 - First I need to Dynamically Import react-slick :
```jsx
const DynamicSlider = dynamic(() => import('react-slick'))
```
2 - Then use the forwardRef api :
```jsx
const ForwardedSlider = React.forwardRef((props, ref) => (
{props.children}
))
```
3 - And use ForwardedSlider :
```jsx
```
Even if my component is rendered, I can't access to the object 'myRef' and can't use my custom buttons
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.