Open Stahlion opened 6 years ago
Seeing the same thing myself
+1
Some of the reactstrap components support the innerRef attribute which allows
you to ref the DOM node of the rendered component. In your specific example
using <Card />
it does not. However, you should be able to get around this by
using the tag attribute and passing a custom component.
import { Card } from 'reactstrap'
const MagicalDiv = ({ innerRef, ...rest }) => <div ref={innerRef} {...rest} />
export default class RefableCard extends React.Component {
render() {
<Card {...this.props} tag={MagicalDiv} />
}
}
This is just a wrapper around the reactstrap card that knows how to pass the
prop innerRef
to the rendered DOM card. Definitely not ideal, but it should
work to give you refs to DOM nodes. You would import it and use it exactly like
a card, but you can now pass innerRef to the <Card />
and get a DOM node.
They have an open issue: reactstrap/reactstrap#877 talking about refs.
Hey, Thanks for an awesome package azazdeaz!
Reading your answers in here https://github.com/azazdeaz/react-gsap-enhancer/issues/3, is it then true that I cannot use & animate e.g. Reactstrap components (like Card) with react-gsap-enhancer? Meaning, you can ONLY apply the package on primitive tags like divs and spans etc(?)
I'm getting a bunch of
..when doing:
Guess it will work anyway being only warnings and all though..