react 使用方法

Updated: 2025-08-19

Hooks 🔗

1. forceUpdate 🔗

1
2
const [state, updateState] = React.useState();
const forceUpdate = React.useCallback(() => updateState({}), []);

Class Componet 🔗

1.forceUpdate 🔗

1
 this.forceUpdate();