Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevTools: Should be able to add a prop that is not yet set #16484

Closed
bvaughn opened this issue Aug 19, 2019 · 8 comments
Closed

DevTools: Should be able to add a prop that is not yet set #16484

bvaughn opened this issue Aug 19, 2019 · 8 comments

Comments

@bvaughn
Copy link
Contributor

bvaughn commented Aug 19, 2019

Right now I can inspect a component and edit its props but I could not find a way to add a new prop that wasn't already set.


Originally reported by @steveluscher via bvaughn/react-devtools-experimental#300

@hristo-kanchev
Copy link
Contributor

I'm currently playing around with this and I would like to get some feedback regarding the visual representation of it.

I presume that we should be able to support more complex data structures, right?

add-new-prop

@bvaughn
Copy link
Contributor Author

bvaughn commented Aug 23, 2019

I like the "+" button.

I think we should probably use JSON.parse to accept new input types, so that would enable strings/ints/booleans/objects/arrays.

FWIW, Style editor already does this (and has an "invalid" style for things that can't be parsed, and single quotation mark handling) so we should use it for prior art.

@hristo-kanchev
Copy link
Contributor

Awesome! Thanks @bvaughn. I'm on it 🚀

@bvaughn
Copy link
Contributor Author

bvaughn commented Aug 28, 2019

By the way, it sounds like this work highly overlaps with #16476. Just mentioning that to make sure you're aware :)

@hristo-kanchev
Copy link
Contributor

@bvaughn What do you think of this style of editing props?

It's aligned with the style editor. 😄

If you are cool with this I can start preparing the branch. 🎉

👇

Number -> String -> null -> Number

props-1


👇
String -> Object

props-2

@bvaughn
Copy link
Contributor Author

bvaughn commented Sep 3, 2019

That looks really nice. Let's do it!

@hristo-kanchev
Copy link
Contributor

That looks really nice. Let's do it!

Cool! I'll try and get it finished by the end of the week. I'll ping you when it's done.
Thanks for the feedback Brian!

@hristo-kanchev
Copy link
Contributor

Update: Almost done! Just finishing up some styling tweaks. PR should be open tomorrow :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants