📅  最后修改于: 2022-03-11 15:02:44.334000             🧑  作者: Mango
import React, { useEffect, useRef } from "react";
const MyComponent = () => {
const myContainer = useRef(null);
useEffect(() => {
console.log("myContainer..", myContainer.current);
});
return (
<>
Ref with react
I can use the DOM with react ref
>
);
};
export default MyComponent;