Skip to content

Bug: Property list does not render repeated spaces properly. #19639

Closed
@sammarks

Description

@sammarks

It looks like the property inspector inside React DevTools is not rendering repeating spaces properly.

I imagine this can result in some fairly frustrating debugging sessions when doing something like string matching 😄

Steps To Reproduce

  1. Create a component that takes a string as a property.
  2. Pass multiple spaces in a row to that property name={'Testing[3 spaces]One Two'} (I would type the actual spaces, but it appears Github truncates the extra spaces even inside the code snippet!)
  3. Inspect that element inside React DevTools.

The current behavior

The value of the prop name is rendered as Testing One Two

The expected behavior

The value of the prop name should be rendered as Testing[3 spaces]One Two


Below are some screenshots of the behavior I'm seeing in production. Here's how the property value is rendered in inspector when it is output directly to the HTML:

image

And here is how that same value is rendered inside DevTools:

image

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions