Great post. Previously I had only seen the React.Fragment or <> </> methods for using fragments. That’s cool to see the destructuring method to use instead. I like that as it semantically helps to know what the element is doing and helping build tools is great too.
I just used the destructuring approach in a Gatsby project of mine. When I first implemented it the code didn't compile, so I came back to this post and found my mistake. I had messed up the import statement. Thanks again!
Great post. Previously I had only seen the React.Fragment or <> </> methods for using fragments. That’s cool to see the destructuring method to use instead. I like that as it semantically helps to know what the element is doing and helping build tools is great too.
Thanks Dave. I'm glad you find the post useful.
I just used the destructuring approach in a Gatsby project of mine. When I first implemented it the code didn't compile, so I came back to this post and found my mistake. I had messed up the import statement. Thanks again!
We all make mistakes as devs. I'm glad the post helped you to fix it.
Oh yes. I’m more than happy to make mistakes and learn from them.
That's not destructuring, it is a named import.
Differences: youtube.com/watch?v=4keUSxNw-KE