question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Double/Duplicate data output (or rendering twice)

See original GitHub issue

Description

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.

image

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:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
KyleAMathewscommented, Dec 21, 2018

@dschau has been working on Cypress testing for development so this would be a good test to add.

0reactions
LekoArtscommented, Dec 21, 2018

@l0co Please open a new issue for that, I think that’s the best way to track it

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found