I have to set an attribute to the fragment. I want to do something like this:
<className="name">
abcd
</>
Is there any way to do like this?
I have to set an attribute to the fragment. I want to do something like this:
<className="name">
abcd
</>
Is there any way to do like this?
You can't since it's React specific and not an HTML tag. Here is what the docs say:
You can use <></> the same way you’d use any other element except that it doesn’t support keys or attributes.