Curly braces { } are special syntax in JSX. It is used to evaluate a JavaScript expression during compilation, A JS exp can be a variable, function, object, any code.
– NsdHSOJul 13 '22 at 21:48
@NsdHSO that's a confusing explanation. It doesn't evaluate an expression at compilation, it destructures a property from an import at runtime in the code here. In JSX, it evaluates the contents as a JS expression at runtime.
– ggorlenJul 13 '22 at 22:05
Yes, line two in OP's code. That's not JSX, it's a destructure of an imported object. You can't destructure a function or "any code".
– ggorlenJul 13 '22 at 22:30
if yes, maybe you can read this https://betterprogramming.pub/understanding-the-difference-between-named-and-default-exports-in-react-2d253ca9fc22#:~:text=Exports%20without%20a%20default%20tag,are%20not%20React%2Dcentric%20ideas. I hope this article to help you
– NsdHSOJul 13 '22 at 22:30
Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/246422/discussion-between-nsdhso-and-ggorlen).
– NsdHSOJul 13 '22 at 22:32
Sorry, I don't have time to explain more than I already have. If you read the article you've shared, you'll see no mention of evaluating expressions at compilation, and no mention of JSX, because those things have nothing to do with destructuring imports.
– ggorlenJul 13 '22 at 22:33