-
Notifications
You must be signed in to change notification settings - Fork 858
Closed
Labels
Description
Describe the Bug
Due to the way the tailwind component works, it renders an array of children, which requires a key.
So the key needs to be appended to the element like so (note the key would be the index of the map:
export function appendKeyToValidElement(element: ReactNode, key: number): ReactNode {
if (isValidElement(element) && element.key === null) {
return cloneElement(element, { key });
}
return element;
}Which package is affected (leave empty if unsure)
@react-email/tailwind
Link to the code that reproduces this issue
https://github.com/resend/react-email
To Reproduce
Start the demo and render the tailwind example. You will see the following warning in the console:
Expected Behavior
React elements should rendered with a valid key.
What's your node version? (if relevant)
No response
MerlinMason, nacho-vazquez, stewones, ruigomeseu, mamlzy and 18 more
