Double/Duplicate data output (or rendering twice)
See original GitHub issueDescription
I get the duplicate output / or a component rendering twice of the data
prop. I thought it might be a Prismic issue https://github.com/angeloashmore/gatsby-source-prismic/issues/45 but it also is like that on Markdown pages. In v1 this didn’t happen.
Steps to reproduce
Clone the using-remark
example repo. Add the line
console.log(this.props.data)
on pages/index.js
after line 10.
Run gatsby develop
.
You’ll see that you get two data sets.
Expected result
Only one allMarkdownRemark
.
Actual result
Two.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Data renders twice with different output - Stack Overflow
Your problem with the duplicate output is because you are assigning the data to randomData initially. React then rerenders (yielding the ...
Read more >My React components render twice and drive me crazy
Hmmm, the I render statement got printed just once, so we cannot reproduce double-rendering with a dead simple function component. # Example ...
Read more >React Components rendered twice — any way to fix this?
Let's find out if there is a way to avoid this problem by trying different implementations. A) Functional Component with useState. function App()...
Read more >Prevent Multiple Renders in React - YouTube
Does your React component render twice ? I have a simple app that has state containing a number. We are using useState and...
Read more >Stop useEffect React Hook re-render multiple times with Async ...
Today I share a quick trick on how to stop unwanted responses from re- rendering a react component whose useEffect has an async...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@dschau has been working on Cypress testing for development so this would be a good test to add.
@l0co Please open a new issue for that, I think that’s the best way to track it