react-devtools

react-devtools: By default DevTools listen to port 8097 on localhost. How to customise?

此生再无相见时 提交于 2021-02-08 04:41:42
问题 I'm trying to install the standalone react-devtools, which by default listens to port 8097. My app uses port 3001. The documentation says the following: "By default DevTools listen to port 8097 on localhost. If you need to customize host, port, or other settings, see the react-devtools-core package instead." How do I go about changing the port to listen to 3001 instead? Source: https://github.com/facebook/react-devtools/tree/master/packages/react-devtools 回答1: The docs advise to have a look

How to detect rerenders in React JS correctly?

核能气质少年 提交于 2021-02-05 10:38:40
问题 Let's say we have a parent component and multiple functional child components. I want to clearly know if the parent re-renders does the child re-renders or not. After going through a few articles I came to know there are 3 ways we can detect rerenders. (Let me know if there are more ways.) 1. Put a console.log in the child component. 2. Use Chrome paint flashing option in the settings. 3. Use React dev tool Do all these ways are correct to know if the component really rerenders? Because it

'Timings' tab in Chrome Performance Profiler Missing

一个人想着一个人 提交于 2021-01-28 09:09:18
问题 So I was successfully monitoring the performance of my React Native App in the Timings section inside the Performance Tab of Chrome Developer Tools . All of a sudden upon a particular reload of the app, the Timings tab went missing . I have tried resetting chrome, restarting my computer and changing a bunch of options inside developer tools but nothing seems to work. Could someone explain what has happened and how I can fix this? Any help would be much appreciated. Thanks! 回答1: So a user on

Unable to see key value in React or Chrome devtools

人走茶凉 提交于 2021-01-07 02:58:32
问题 Consider the following JSX with an intentionally added duplicate key: <table> <tbody> <tr key="row1"> <td>row1_col1</td> </tr> <tr key="row1"> <--- same key here <td>row2_col1</td> </tr> </tbody> </table> As expected this leads to index.js:1 Warning: Encountered two children with the same key, row1 . Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change

Unable to see key value in React or Chrome devtools

蓝咒 提交于 2021-01-07 02:56:55
问题 Consider the following JSX with an intentionally added duplicate key: <table> <tbody> <tr key="row1"> <td>row1_col1</td> </tr> <tr key="row1"> <--- same key here <td>row2_col1</td> </tr> </tbody> </table> As expected this leads to index.js:1 Warning: Encountered two children with the same key, row1 . Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change

Is it possible to write a script to inject props on a React component?

泪湿孤枕 提交于 2021-01-04 09:19:49
问题 So this is a little crazy. There's a web app that I use that is built with React, which has made certain design decisions that I disagree with. Luckily, the design is actually simple to change exactly the way I want. I can just open the Chrome React devtools and change the props assigned to a specific component. But I don't want to manually do this every time, that's not worth it. I want to write a (super hacky) personal bit of javascript that I can inject into the page, which modifies the

Is it possible to write a script to inject props on a React component?

末鹿安然 提交于 2021-01-04 09:19:08
问题 So this is a little crazy. There's a web app that I use that is built with React, which has made certain design decisions that I disagree with. Luckily, the design is actually simple to change exactly the way I want. I can just open the Chrome React devtools and change the props assigned to a specific component. But I don't want to manually do this every time, that's not worth it. I want to write a (super hacky) personal bit of javascript that I can inject into the page, which modifies the

ReactJs - Hide state and props

爱⌒轻易说出口 提交于 2019-12-08 02:08:08
问题 I'm currently working on a project and just started out working with ReactJs. (so still a noob) And I'm asking myself: Users who use the React dev tools can see all your props and states. How can I prevent users from seeing e.g. IDs and more 'private' stuff? Thanks in advance 回答1: This isn't actually a ReactJS question, but a Web Browser / Internet architecture question. Unfortunately the data will always be available in the client to be intercepted, that's because they need the data at their