实现
useUpdate/index.js
import React, { useCallback, useState } from "react";
function useUpdate() {
const [, setState] = useState({});
return useCallback(() => setState({}), []);
}
export default useUpdate;
import React, { useCallback, useState } from "react";
function useUpdate() {
const [, setState] = useState({});
return useCallback(() => setState({}), []);
}
export default useUpdate;