[React] Class components, Refs & injectIntl #3386
Answered
by
QuarkMuncher
QuarkMuncher
asked this question in
Q&A
Replies: 1 comment
-
//Fish.jsx
class Fish extends React.Component {}
export default injectIntl(Fish, {forwardRef: true});
//App.jsx
import Fish from './Fish';
export default function App() {
const fishRef = useRef();
return <Fish ref={fishRef} />;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
QuarkMuncher
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As the title Suggest, I am attempting to pass a ref to a class component where I also need access to react-intl, the way I try to is:
This results in the following error message:
Is there a way I can pass the ref through injectIntl?
Beta Was this translation helpful? Give feedback.
All reactions