react-email issue about keys - Each child in a list should have a unique "key" prop.
I created issue in github about this issue - please answer there
https://github.com/resend/react-email/issues/1150
GitHub
Warning: Each child in a list should have a unique "key" prop. Ā· Is...
Describe the Bug Warning: Each child in a list should have a unique "key" prop. When I run this code useEffect(() => { async function renderEmail() { const emailMessageString = await r...
8 Replies
Haven't you tried giving a key prop to the component you render? You only render a <CheckEmail> component, so I guess that's where .key is needed. Try adding a key prop with unique value for each time the component renders. If the deliveryDate prop is always unique that can be used, or something like performance.now() , the uuid package, or combination of random data. It's normal for many use cases in React and probably not a bug.
Your useEffect probably needs dependencies in the array. I'm guessing deliveryDate and setEmailMessageString both are needed as dependencies.
Disabling the linter in this case is not necessary or good practice.
Please answer on github
If you have solution or possible solution message steps to fix it
otherwise I find it as not usefull help
I tried to use random key everywhere I use tailwind in
CheckEmail
Also I tried to add it here
It didn't help
About deps
It's correct and it should be triggered once
Please answer on github
@Nikita this isn't a place where you can just advertise your github issues
If you want to ask questions here, that's fine, but please include the info needed for people to help you in the question and accept answers here. If you want to link to a github issue as well as including the info in the question, that's fine too.
But please don't post and then tell people to go to a different site just because it's mildly inconvenient for you.
and putting this in heading 1 font is just rude
@Nikita if you have trouble keeping tabs on these questions in discord, just set this on all your question posts, it'll ping you when people message you in your posts
Damn, it's been five days. I was kinda waiting for the op to be more rude afterwards lol..
Loved the way you handled this though..
š