Just give it as innerRef
,
// Client.js
<Input innerRef={inputRef} />
Use it as ref
.
// Input.js
const Input = ({ innerRef }) => {
return (
<div>
<input ref={innerRef} />
</div>
)
}
More Related Contents:
- React-router-v6 access a url parameter
- Detecting user leaving page with react-router
- React router changes url but not view
- Why do I get the error “expressions must have one parent element”, how do I fix this?
- What is the best way to redirect a page using React Router? [closed]
- React Router Pass Param to Component
- How to stop /#/ in browser with react-router?
- Material UI v4 makeStyles exported from a single file doesn’t retain the styles on refresh
- Change border color on Material-UI TextField
- react-router-dom useParams() inside class component
- Cannot read property ‘history’ of undefined (useHistory hook of React Router 5)
- How do you programmatically update query params in react-router?
- Invariant failed: You should not use outside a
- Setting text color, outline, and padding on Material-ui Autocomplete component
- Using React-Router with a layout page or multiple components per page
- Use history.push in action creator with react-router-v4?
- Is it possible to override material-ui components default props?
- How to use MUI v5 makeStyles without ThemeProvider?
- Page layout broken in React Router v6
- React App goes blank after importing React-Router-Dom
- Media queries in MUI components
- Pass object through Link in react router
- Material-ui adding Link component from react-router
- React Router v4 with multiple layouts
- Property ‘value’ does not exist on type ‘never’. when use useRef hook in mui
- How to add custom Material UI palette colors
- Passing props to Material UI styles
- Media queries in Material UI components
- React Router work on reload, but not when clicking on a link
- Material-Ui TextField not affected with the RTL direction