You are building a web that has a text editor for user to input. You can use the textarea element to create a text editor. But it is boring, you want the text editor also has the line numbers in the left just likes a code editor. Today, I will show you how to make... Continue Reading →
How to solve the “Warning: Can’t perform a React state update on an unmounted component.” when using React Hooks
Situation You are having a React Component using Hooks. In that component, you use useEffect to perform some asynchronous actions and update the component state. const [count, increase] = useState(0); useEffect(() => { //count will increase after 3 secs setTimeOut(() => increase(count++), 3000); }); Problem When you run the app and there is a warning... Continue Reading →
ID VERSUS CLASS IN HTML
When I started working with HTML, I was confused about the id attribute and the class attribute of an element. I didn't know the differences between them so I used them arbitrarily. After some small projects, I have realized their differences and how to use them more correctly. Let's see the definition of those attributes:... Continue Reading →