Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Fanny
Fanny

Posted on

     

How to copy props in react dev tools

Today, while I was working on a bug, I found myself needing to copy a props of a React component, so I realized that the react dev tools did not have this functionality, after some searches, i found the solution.

EDIT: react dev tools has apretty simple solution, thanks to Eugene

  1. Open theReactDevTools in Browser
  2. Select the component that contains the props, in that you need copy(when you make this, the browser will be create a variable for save the component that you clicked, generally the name is $r)
  3. Open the console, and save the prop in another variable
  4. Use the copy method and "don't worry, be happy! :D" as me.

Cheers! 😗 😗 ❤️

Top comments(9)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
karataev profile image
Eugene Karataev
undefined is not a function
  • Location
    Russia, Novosibirsk
  • Joined

Nice tip! There is also an easier way - just right-click on an element and select 'Copy element props'.
copy props

CollapseExpand
 
fannyvieira profile image
Fanny
Master of none &passionate by computer challenges.
  • Education
    Computer Science, Federal University Of Campina Grande
  • Work
    Enterprise Engineer Intern at Facebook
  • Joined

I didn't know, thank you! ❤️

CollapseExpand
 
ben profile image
Ben Halpern
A Canadian software developer who thinks he’s funny.
  • Email
  • Location
    NY
  • Education
    Mount Allison University
  • Pronouns
    He/him
  • Work
    Co-founder at Forem
  • Joined

Nice! This is gonna help a future searcher.

CollapseExpand
 
fannyvieira profile image
Fanny
Master of none &passionate by computer challenges.
  • Education
    Computer Science, Federal University Of Campina Grande
  • Work
    Enterprise Engineer Intern at Facebook
  • Joined

yes, of sure! 😃

CollapseExpand
 
arimourao profile image
Ari Mourao
I make my living of my passion of a free internet!
  • Location
    Somewhere south of Equador
  • Work
    Fullstack Developer struggling with my frontend skills
  • Joined

Nice tip! Only now I'm having the opportunity to get deeper with React. This will be helpful.

CollapseExpand
 
fannyvieira profile image
Fanny
Master of none &passionate by computer challenges.
  • Education
    Computer Science, Federal University Of Campina Grande
  • Work
    Enterprise Engineer Intern at Facebook
  • Joined

I'm really glad to hear that. thanks! ❤️ ❤️

CollapseExpand
 
vijayjangid profile image
Vijay Jangid
10+ Years of experience working in Frontend Engineering. Web & UI Development. React expert.
  • Location
    Jaipur, India
  • Joined
• Edited on• Edited

Reminds me of my first encounter of the same situation. I was aware of $, $$, $1 in DOM element panel, but no idea about React.
Definately a help for fellow dev.

CollapseExpand
 
zyzmoz profile image
Daniel Cunha (he/him)
Minimalist, gamer and tech geek
  • Location
    Vancouver, Canada
  • Education
    Software Engineer MBA
  • Work
    Software Developer at Global Relay
  • Joined

Nice one!

CollapseExpand
 
thayannevls profile image
Thayanne Luiza
I'm passionate about Open Source and learning new things.
  • Location
    Campina Grande, Brasil
  • Education
    Computer Science, Federal University of Campina Grande, Brazil.
  • Work
    Software Engineer Intern at VTEX
  • Joined

Cool!

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Master of none &passionate by computer challenges.
  • Education
    Computer Science, Federal University Of Campina Grande
  • Work
    Enterprise Engineer Intern at Facebook
  • Joined

More fromFanny

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp