Does `<Component />` or `<Component></Component>` really make a difference
Unanswered
Virginia's Warbler posted this in #help-forum
Virginia's WarblerOP
Single vs double tag components. Is there really a difference between them?
eg, in terms of quality or performance?
eg, in terms of quality or performance?
2 Replies
No it doesn't make a difference, but if the component does not accept children, or if you aren't rendering any children under that component you should use the self-closing tag
<Component />
to show that, and it helps keep your code cleaner.Virginia's WarblerOP
Thank you