DEV Community

Stanley Amaziro
Stanley Amaziro

Posted on

I have been learning the React framework for a while now. Here is what I understand:

  • React is a JavaScript framework, popular, lightweight, and compiles faster.
  • React is about writing reusable components as functions,
  • Exporting them and using them anywhere by importing.
  • These "<>…</>" are called fragments - they let you group multiple elements without extra HTML wrappers.

Here is how fragments differ from regular HTML tags

  • Fragments (<>…</>) let you group multiple elements without adding extra nodes to the DOM.
  • Useful when you want to return multiple elements from a component but avoid unnecessary wrappers like .
  • Keeps the HTML structure clean and minimal, and easily maintainable
  • You can also write <> as </> if you want to add keys or props. Basically, fragments are a lightweight way to bundle elements together inside your component without cluttering the DOM tree.

Top comments (0)