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.

Snapshot issue for Fragment

See original GitHub issue

Two different snapshots are getting generated using shallow for below component

Component: import React, { Component, Fragment } from 'react'; <Fragment> <Header location={location} matchUrl={match.url} /> <section className="ps"> <Switch> <Route path={${matchUrl}/topics} component={TopicsContainer} /> <Route path={${matchUrl}/people} component={PeopleContainer} /> <Route path={${matchUrl}/tools-and-frameworks} component={ToolsAndFrameworksContainer} /> <Route path={${matchUrl}} component={HomeContainer} /> </Switch> </section> </Fragment>

Snapshot 1: <React.Fragment><Headerlocation={Object {"pathname": "/practices/test_9995",} } matchUrl="/practices/test_9995"/><section className="ps"><Switch><Routecomponent={[Function]}path="/practices/test_9995/topics"/><Routecomponent={[Function]}path="/practices/test_9995/people"/><Routecomponent={[Function]}path="/practices/test_9995/tools-and-frameworks"/><Routecomponent={[Function]}path="/practices/test_9995"/> </Switch></section></React.Fragment>

Snapshot 2:

<Fragment><Headerlocation={Object {"pathname": "/practices/test_9995",} } matchUrl="/practices/test_9995"/><section className="ps"><Switch><Routecomponent={[Function]}path="/practices/test_9995/topics"/><Routecomponent={[Function]}path="/practices/test_9995/people"/><Routecomponent={[Function]}path="/practices/test_9995/tools-and-frameworks"/><Routecomponent={[Function]}path="/practices/test_9995"/> </Switch></section></Fragment>

What could be the possible reason for <React.Fragment></React.Fragment> in first and <Fragment></Fragment> in latter for same component?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Mayank009commented, Aug 10, 2018

@ljharb fixed after updating version of enzyme-adapter-react-16 to 1.2.0

0reactions
Mayank009commented, Aug 10, 2018

@ljharb

“enzyme”: “3.4.1”, “enzyme-adapter-react-16”: “1.1.1”

Read more comments on GitHub >

github_iconTop Results From Across the Web

Snapshot issue for Fragment #1735 - GitHub
I upgraded enzyme version to 3.4.1 but still getting Symbol(react.fragment) as name for Fragment in debug. I checked enzyme-to-json code, which ...
Read more >
Jest - Snapshot test fail after adding '</React.Fragment>'
Fragment>' to the component file and ever since then the test has failed. Yes that's why it failed because your component changed. See...
Read more >
activity-lint should detect that fragment:1.4.0 ... - Issue Tracker
Issue 184847092 · activity-lint should detect that fragment:1.4.0-SNAPSHOT is greater than fragment:1.3.0 · Issue metadata.
Read more >
Fragments of Music - Snapshot 22w16a Is Out! : r/Minecraft
A chance to re-live the good old times appears in snapshot 22w16a with the ability to de-fragment a Disc - a new Music...
Read more >
Fragment Analysis Support—Troubleshooting - US
How do I begin troubleshooting my fragment analysis experiment? ... My SNaPshot™ Multiplex Kit control reaction does not match the sizes given in...
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