Forward Ref with SVG

const ComponentToRender = dynamic(() => import('./../lib/assets/svg/1.svg'), {
loading: () => <p>Loading...</p>,
})
// eslint-disable-next-line react/display-name
const ForwardedRefComponent = React.forwardRef((props, ref) => (
# I get an error here
<ComponentToRender {...props} forwaredRef={ref}/>
))
const ComponentToRender = dynamic(() => import('./../lib/assets/svg/1.svg'), {
loading: () => <p>Loading...</p>,
})
// eslint-disable-next-line react/display-name
const ForwardedRefComponent = React.forwardRef((props, ref) => (
# I get an error here
<ComponentToRender {...props} forwaredRef={ref}/>
))
1 Reply
Develliot
Develliot2y ago
Could put ref on a wrapping div or is that cheating?
Want results from more Discord servers?
Add your server