# Copy React Props to Your Clipboard in Google Chrome

14 July 2018 · [DevTools](https://devinschulz.com/tags/devtools/index.md), [Today I Learned](https://devinschulz.com/tags/today-i-learned/index.md)

Learn how to copy React props to your clipboard using Google Chrome and the React Developer Tools.

Archived writing, published in 2018. I’ve fixed some grammar since, but otherwise it’s as I wrote it, so some details may have aged.

---

While working on a React project today, I was looking to copy a property passed down to a component. After searching around, I found out it's
surprisingly easy.

1. Open up the
   [React Developer Tools](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en)
   tab within the Chrome inspector.
   ![Step one, selecting the React tab within the Google Chrome developer tools](https://devinschulz.com/images/blog/step1_hu_aef1c17dd3b9cf15.webp)
1. Select the component or element that contains the property you want to copy.
   ![Step two and three, selecting a component and then right-clicking the indicator](https://devinschulz.com/images/blog/step23_hu_86ee7075b876da21.webp)
1. Right-click the `{…}` and select **Store as global variable** from the menu.
1. Navigate to the console tab.
   ![Step four and five, navigating to the console tab and then taking notice of a new variable.](https://devinschulz.com/images/blog/step45_hu_100add734f086cd4.webp)
1. You will notice a global variable was added with a naming convention similar
   to `$tmp` or `temp1`.
1. Copy the value to your clipboard by typing `copy($tmp)` into the console.
   ![Step 6, copying the value to your clipboard](https://devinschulz.com/images/blog/step6_hu_373c87a66a9f20a2.webp)

What's great about this trick is almost any value that has the `{…}` beside it
within the Chrome inspector can be set as a global variable. Therefore, this
method is not limited to the React Developer Tools.

---

Source: https://devinschulz.com/blog/copy-react-props-to-your-clipboard-in-google-chrome/

