You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using strings of HTML like this is not a good idea in React. For a start (as you noticed) it forces you to bring in some other library that can understand HTML. Also React already supports rendering DOM elements natively, so this isn't necessary.
Instead of building up a string of HTML you can build up an array of React Elements using JSX:
week5-bereket-minju/src/components/movies.jsx
Lines 33 to 35 in c89c27d
week5-bereket-minju/src/components/movies.jsx
Line 57 in c89c27d
Using strings of HTML like this is not a good idea in React. For a start (as you noticed) it forces you to bring in some other library that can understand HTML. Also React already supports rendering DOM elements natively, so this isn't necessary.
Instead of building up a string of HTML you can build up an array of React Elements using JSX:
React can handle an array of elements like that just fine
The text was updated successfully, but these errors were encountered: