实现
useMount/index.js
import React, { useEffect } from "react";
function useMount(fn) {
useEffect(() => {
fn();
}, []);
}
export default useMount;
import React, { useEffect } from "react";
function useMount(fn) {
useEffect(() => {
fn();
}, []);
}
export default useMount;