Next.js Discord

Discord Forum

Invalid prop `data-headlessui-state` supplied to `React.Fragment`. React.Fragment can only have `key

Answered
Leafcutting bee posted this in #help-forum
Open in Discord
Avatar
Leafcutting beeOP
How to fix this message or surpress, just to hide it? It doesn't break anything and we don't use any props on React.Fragment. Maybe some 3rd party packages... it really annoys
Answered by Anay-208
React.Fragment only accepts key. You can replace it with div
View full answer

14 Replies

Avatar
React.Fragment only accepts key. You can replace it with div
Answer
Avatar
Leafcutting beeOP
I understand, but we don't use React.Fragment in code, it can be done by some UI libraries that we have no access to update
Avatar
Can you open a issue in that specific Ui Library?
Avatar
Leafcutting beeOP
but I'm not sure to which library it's related and even if it's related to it. I don't see any useful info in logs. Is there a way to make logs more informative?
Image
@Anay-208 is it possible to have some kind of filter function (like error middleware) in nextjs to check that error and decide what we can supress and what to throw?
Avatar
headless ui
Avatar
Leafcutting beeOP
@Anay-208 I've just removed headless ui package and all it's usages. The error is still there
Avatar
I'm unsure about that
Try searching React.fragment in search
Avatar
Leafcutting beeOP
@Anay-208 what is xosw wsiroe?
Avatar
I edited msg
Avatar
Leafcutting beeOP
I see now. On project we use only key on Fragment. Anyway, thank you for trying helping me.
Avatar
Mark solution please.
thats what I told here