DEV Community

loading...

Discussion on: Virtual DOM in React

Collapse
lexlohr profile image
Alex Lohr

Another solution is not to create a new node every time, but store the nodes directly, especially when they're static anyways:

// Don't
const MyStaticFC = () => <div>...</div>

// Do
const MyStaticNodes = <div>...</div>
Enter fullscreen mode Exit fullscreen mode
Collapse
deepansh946 profile image
Deepansh Bhargava Author

Yeah agreed.