Skip to content
This repository was archived by the owner on Jun 26, 2020. It is now read-only.
This repository was archived by the owner on Jun 26, 2020. It is now read-only.

The "Copy element props" feature does not do a deep-copy #843

Closed
@aozdemir-coursera

Description

@aozdemir-coursera

The copy props feature was introduced in #837. It's awesome, but has a substantial flaw: it only copies as deeply as the user has expanded the properties in the property explorer.

Reproduction steps:

  1. Go to Coursera's home page. If you were logged in, log out.
  2. Open the React extension.
  3. Search the inspector for "FrontPage2016" and select the node.
  4. Copy its props and paste them into a temporary file: before.json.
  5. Expand the naptime prop in the prop explorer. Then unexpand it.
  6. Copy the same node's props and paste into a temporary file: after.json.
  7. diff before.json after.json
  8. Cry

I have no familiarity with the React DevTools codebase, but I suspect that this is a side-effect of a lazy system designed to minimize communication with the React runtime. Assuming there is a way to say "Recursively eagerly evaluate this piece of data", there should be an easy fix.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions