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
Description
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:
- Go to Coursera's home page. If you were logged in, log out.
- Open the React extension.
- Search the inspector for "FrontPage2016" and select the node.
- Copy its props and paste them into a temporary file:
before.json
. - Expand the
naptime
prop in the prop explorer. Then unexpand it. - Copy the same node's props and paste into a temporary file:
after.json
. diff before.json after.json
- 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.