Custom instructions (defineDirective) and hook functions (created, mounted, updated, unmounted) in Vue3

Directory Custom instructions Example 1 Example 2 hook function The relationship between custom instructions and hook functions This article mainly introduces the use of custom instructions and hook functions in Vue3 and the relationship between them. Custom directive In Vue3, custom directives are a way to extend Vue’s template syntax. Custom directives are actually a […]

Bug Resolved – Warning: Cant call setState (or forceUpdate) on an unmounted component (React)

Blogger Maotouhu () takes you to Go to New World? Blog homepage: Maotouhu’s blog “Complete Column of Interview Questions” Articles with pictures and texts Vivid images Simple and easy to learn! Everyone is welcome to step in~ “IDEA Development Cheats Column” Learn the common operations of IDEA and double your work efficiency~ “Master Golang in […]

How to use the diskutil command on the terminal to mount and unmount the external hard disk on Mac

Recently, when using macOS to mount an external hard drive, I couldn’t mount it using mount. Many articles didn’t describe various situations in detail, so I wrote a blog to record it. How to mount and unmount hard disk (or partition) mount and umount cannot be used on macOS, if used, it will display unknown […]

[Solved] The solution to unmount the react component created by the createRoot() method when calling the ReactDOM.unmountComponentAtNode() method to report an error

When uninstalling the top-level component directly mounted in index.html, the following two errors occurred: Warning: You are calling ReactDOM.unmountComponentAtNode() on a container that was previously passed to ReactDOMClient.createRoot(). This is not supported. Did you mean to call root.unmount()? Warning: You are calling ReactDOM.unmountComponentAtNode() on a > container that was previously passed to ReactDOMClient.createRoot(). > This […]

[Solved] React hooks functional component solution: Can’t perform a React state update on an unmounted component

const [value, setValue] = useState(”); //…. useEffect(() => {<!– –> fetchValue().then(() => {<!– –> setValue(“fetch_done!”); // triggers react memory leak }); }, []); Workaround useEffect(() => {<!– –> fetchValue().then(() => {<!– –> setValue(“done!”); // triggers react memory leak //add }); return ()=>setValue(”) //Return the problem setstate to the default value }, []); Lifecycle useEffect(() => […]