Many developers struggle to understand topics like Callbacks, Promises, and Async/Await, one of the reasons may be not understanding the actual need and core logic behind them.
Having a good grasp of this topic can help you understand them more easily.
This can be better explained with the help of an example.
Imagine you gave your friend a set of tasks:
What your friend now does is, he first completes task one and head to an adjacent town, and let’s say that takes x amount of time. Then he comes back to you, gives you video games, and then goes to perform the second task, and let’s say it takes y amount of time. The total time taken is x+y. This was just a couple of tasks but imagine there are hundreds of them, the total time is taken increases rapidly if he is a single person doing all the tasks one by one in the order they are given. …
In this article, we will be discussing what
dangerouslySetInnerHTML is, how it is used, what the differences are between
innerHTML, and a real project where it proves to be useful.
dangerouslySetInnerHTML is an attribute under DOM elements in React.
According to the official documentation,
dangerouslySetInnerHTML is React’s replacement for using
innerHTML in the browser DOM.
This means that if in React if you have to set HTML programmatically or from an external source, you would have to use
dangerouslySetInnerHTML instead of traditional
In simple words, using
dangerouslySetInnerHTML, you can set HTML directly from React.
The full version is deployed at https://poke-mon.now.sh/
This project is inspired by Chris on…