StyledPanel is a styled div. When I submit the form, I update my Redux store. This in turn appears to trigger a re-render of everything inside StyledPanel. Removing StyledPanel fixed the problem, so it seems to be something specific to Stitches.
Any ideas what I'm doing wrong?
If necessary I'll post a CodePen, but maybe someone can see what I'm missing. Any help would be greatly appreciated.
Found the problem – stupid mistake, I was defining StyledPanel inside the component, so of course it was re-rendering every time a state change happened 🤦 Moving it outside the component fixed things.
Bug report
Describe the bug
Something extremely strange – which might just be me doing something stupid, but I can't for the life of me see what I'm doing wrong.
Consider the following code:
StyledPanel is a
styled
div. When I submit the form, I update my Redux store. This in turn appears to trigger a re-render of everything inside StyledPanel. Removing StyledPanel fixed the problem, so it seems to be something specific to Stitches.Any ideas what I'm doing wrong?
If necessary I'll post a CodePen, but maybe someone can see what I'm missing. Any help would be greatly appreciated.