repository
stringclasses
156 values
issue title
stringlengths
1
1.01k
labels
stringclasses
8 values
body
stringlengths
1
270k
facebookreact
read late state value in event handler
Question
I have this question I could have ask on stack overflow but I think it be more suitable for people from react team or more experienced user so I will give it a try to ask it here imagine I have event handler below where I want to read late state value and do something with it however not do a new setstate onclick let datum this state datum api makerequest url datum here 1 dan abramov say it be safe to read state in event handler in the sense it will be up to date however he say this apply to react 16 otherwise he suggest to use functional setstate to get current state I have question what if I want to read late state value in event handler however such that it work also in later react version 17 without hook one option imho would be to use functional setstate but what if like in the beginning of question I say I don t want to setstate just read the state value and do something with it like network request so use functional setstate wouldn t be right for I as it would force I to update state right or I could return empty object from functional setstate to avoid update state and put the network request code inside it like this onclick this setstate ps use this form only to read current state in event handler which work for 16 and onwards version probably but this break purity of this function api makerequest url ps data return but then I would violate that the function pass to functional setstate must be pure be there a solution to the question I ask 1
facebookreact
error could not find node with i d 16070 in commit tree
Bug
describe what you be do when the bug occur 1 open profiler 2 record 3 switch to waterfall please do not remove the text below this line devtool version 4 0 6 a39d9c3 call stack at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11442 at map foreach at commitindex chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11388 at e getrankedchartdata chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11921 at xi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 277807 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55891 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 98281 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84256 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81286 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25364 component stack in xi in div in div in div in ir in unknown in n in unknown in div in div in wa in ce in be in so in vl
facebookreact
concurrent mode app stop update rendering on inactive tab
Bug
do you want to request a feature or report a bug bug what be the current behavior 1 when concurrent mode be enable 2 and the chrome tab be inactive 3 and a new render happen inside app 4 the app win t render this update until I open the chrome tab this only happen on concurrent mode I notice this because I update the document title on a react context like this and on concurrent mode it be never update when the tab be inactive only when I open the tab disable concurrent mode be enough for it to start work as expect I believe this be relate to the chrome throttle behavior of inactive tab for example chrome doesn t resolve neither requestidlecallback neither requestanimationframe when the tab be inactive make this non react example just to show this chrome behavior because I believe it s relate reproduction use useeffect and allow change between legacy sync concurrent mode incorrect behavior sync or concurrent mode it get s completely suspend reproduction concurrent gif what be the expect behavior inactive tab should have the same behavior with or without concurrent mode they should keep update render thing ok if a little bit throttle but not completely pause do thing until the tab become active correct behavior gif which version of react and which browser os be affect by this issue do this work in previous version of react react 16 9 chrome 76 macos
facebookreact
add third parameter to usestate to get current value
Question
do you want to request a feature or report a bug feature what be the current behavior if you set a callback on something e g inside useeffect your callback capture the current value of that state and can never update it to know the most up to date value you currently have to call the setter with a function contain the new value even if you only return the value you receive from it cf comment102122412 57847594 what be the expect behavior there should be a way to access the current state via a getter for these situation add this as a third return value from usestate would be non intrusive and backwards compatible which version of react and which browser os be affect by this issue do this work in previous version of react n a
facebookreact
component sometimes fire event handler twice
Bug
do you want to request a feature or report a bug I want to report a bug what be the current behavior event handler on element be fire twice when hover from one element onto the next if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below what be the expect behavior event handler should only fire once which version of react and which browser os be affect by this issue do this work in previous version of react react 16 8 4 reactdom 16 8 4 chrome 76 0 3809 132 firefox 69 0 64 bit edge 44 18362 267 0
facebookreact
devtool component tree navigation
Question
do you want to request a feature or report a bug feature what be the current behavior where be no way to collapse expand component tree or it subtree if I pick element with select element button I get all the tree expand not the only one subtree where select element come from probably bug and I don t find way to collapse tree so if you pick something from page your component tree be basically be always expand on all level maybe we can have select row context menu like the one in chrome devtool with option to collapse expand image image also I guess it maybe good place to add
facebookreact
window print crash if a print event listener cause a rerender chrome dev mode only
Bug
do you want to request a feature or report a bug report a bug what be the current behavior programmatically call window print can cause react to report strange error before crash under certain circumstance the trigger seem to be a call to print that result in a react state change somewhere which in chrome seem to happen because the print preview it show can cause medium query event which can be hook up to call to a setstate function this do not always happen however as show in the example if the code be not call from in a settimeout it doesn t seem to crash in addition if the user initiate print instead e g via ctrl p react never crash the two error I ve see happen as a result of this be fail to execute handleevent on eventlistener the provide callback be no long runnable need pause on catch exception in chrome s devtool to catch and after a few of those they re follow by maximum update depth exceed even though the setstate function be only call once once this happen there s a good chance the tab become completely unresponsive after the print dialog be close if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem a minimal example can be find here there be no external dependency the code be comment with instruction to reproduce the behavior I ve also include a copy of the code here for completeness sake jsx import react from react import reactdom from react dom custom hook to match medium query the setmatch call in this function be at the bottom of the error stack function usemediaquery query const match setmatch react usestate window matchmedia query match react useeffect const querylist window matchmedia query if this function be not call the crash do not occur when window print be call this effect be run as a consequence however react handle it cause error and other strange behavior because firefox handle printing differently it do not crash while this be an example of use setstate in useeffect it be only run once before the error be throw anyway const handlematch setmatch querylist match handlematch bookkeeping not relevant to the crash querylist addlistener handlematch return querylist removelistener handlematch query return match export function app this be the simplist medium query that will cause a crash but anything will work as long as it s different during printing for example max width 1260px also work if the window be wide enough let isprint usemediaquery print return important only chrome crash firefox and likely other be safe you may need to open this page in its own window instead of the code sandbox split screen settimeout window print 100 crash crash window print do not crash do not crash note that press ctrl p never crash if you click the button to call window print react will behave strangely once the print preview be about to show suddenly an error fail to execute handleevent on eventlistener the provide callback be no long runnable will be throw after that happen a few time a maximum update depth exceed error will be throw even though the setstate function be only call once print with ctrl p win t crash click the button to print will function syncprint window print function asyncprint settimeout window print 100 const rootelement document getelementbyid root reactdom render rootelement what be the expect behavior react should not throw error after call window print even if do so cause state change which version of react and which browser os be affect by this issue do this work in previous version of react this be the late release 16 9 0 I be unsure if other version of react be affect the behavior be test use chrome 76 on window 10 this behavior will not happen in firefox and likely other browser as well probably due to the unique way chrome handle printing and print preview
facebookreact
error could not find node with i d 44300 in commit tree
Bug
describe what you be do when the bug occur 1 read the flamegraph of my react app 2 click on one of the option in the render at list of the graph image 3 this cause the below error to appear in react devtool please do not remove the text below this line devtool version 4 0 6 a39d9c3 call stack at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11442 at map foreach at commitindex chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11388 at e getrankedchartdata chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11921 at xi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 277807 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55891 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62940 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99536 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84256 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81286 component stack in xi in div in div in div in ir in unknown in n in unknown in div in div in wa in ce in be in so in vl
facebookreact
devtool fail to execute postmessage on window could not be clone
Bug
do you want to request a feature or report a bug report a bug what be the current behavior new dev tool be work fine but I have a particular component that when it mount the dev tool no long can inspect anything about it when I select it the right hand side just say loading and nothing ever load interactive as you can see from the gif above before I click on that particular component that seem to break I have no error in my console but as soon as I click on the component that break or any of its child the number of console error go up by one the error in the console look like this screen shoot 2019 09 06 at 4 08 14 pm backend js 1 uncaught domexception fail to execute postmessage on window could not be clone at object send chrome extension fmkadmapgofadopljbjfkapdkoienihi build backend js 1 94424 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build backend js 9 5785 hard to provide step to reproduce this since it s a custom component with business specific logic so can t provide the code but I try google ing this problem and error and nothing show up so figure post it here might help if other out there on the interwebs be have the same issue and they can comment here what be the expect behavior inspect any mount component will work which version of react and which browser os be affect by this issue do this work in previous version of react currently on react react dom 16 3 and the previous dev tool work just fine I could inspect any component and see it s datum but the latest update break that
facebookreact
troubleshooting instruction link update
Bug
do you want to request a feature or report a bug bug what be the current behavior link to troubleshooting instruction in the devtool extension disabled popup be outdate it be point here the react tab do not show up which be redirect here if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below link need to be update not sure what the correct link be what be the expect behavior link need to be update not sure what the correct link be
facebookreact
compile error react refresh babel 0 4 0
Bug
use react refresh babel 0 4 0 be give I this error on a large number of file error in orbit app src hook usestore ts module build fail from node modules babel loader lib index js typeerror can not read property 0 of undefined at function get user nw project motion orbit node modules babel traverse lib path index js 115 33 at nodepath unshiftcontainer user nw project motion orbit node modules babel traverse lib path modification js 191 31 at pluginpass exit user nw project motion orbit node module react refresh cjs react refresh babel development js 546 28 I narrow down that file to the simple thing that cause it import usecontext from react export default usecontext originally post by natew in issuecomment 528708174
facebookreact
devtool uninitialized context be display as an empty object
Enhancement
when inspect a component that be miss context it be display as an empty object meanwhile if the state be not initialize it be not display at all for no prop it be display the string none in my humble opinion it be mislead that no context be display as an empty object
facebookreact
react devtool downgrade not work for chrome
Question
do you want to request a feature or report a bug bug what be the current behavior the follow command fail yarn run test chrome error message yarn run v1 17 3 node shell chrome test internal validator js 112 throw new err invalid arg type name string value typeerror err invalid arg type the file argument must be of type string receive type object at validatestre internal validator js 112 11 at normalizespawnargument child process js 398 3 at spawn child process js 534 16 at launchchrome home andrei src react devtool node modules chrome launch index js 27 12 at object home andrei src react devtool shell chrome test js 9 1 at module compile internal module cjs loader js 936 30 at object module extension js internal modules cjs loader js 947 10 at module load internal modules cjs loader js 790 32 at function module load internal modules cjs loader js 703 12 at function module runmain internal modules cjs loader js 999 10 error command fail with exit code 1 what be the expect behavior launch a new browser window the follow command work yarn run test firefox which version of react and which browser os be affect by this issue do this work in previous version of react use version 76 0 3809 100 official build 64 bit usr bin google chrome stable be aliase to chrome any help be appreciate we re run a old version of react at work and upgrade it would be nontrivial hence I need the old version of the react devtool
facebookreact
react devtool 4 be break for react 0 14
Duplicate
there be already an issue open for this however it have be lock I m only open a new issue to add some additional information as the current outcome isn t ideal I work for a very large sport apparel company out of baltimore with various application of vary age some of our new application be run react late however we still have many legacy application on 0 14 7 while we re work to replace these the eol for many be still at least a year out accord to the last post issuecomment 525022121 by gaearon the solution be to install the 3 x version this be not ideal since we re still also work on react late switching between extension version be not manageable ideally instead of a well error message react dev tool 4 x just wouldn t throw l264 at all for 0 14 x currently it break the application when dev tool be open I use chrome I d rather at least have console and redux dev tool when I have to work on our legacy app than nothing at all it s perfectly understandable that support for 0 14 x be nix but should the late version break legacy react application just because I have chrome dev tool open doesn t mean I intend to use react dev tool but with the late extension I can t use chrome dev tool at all so perhaps it make more sense just to display the error in the react dev tool tab
facebookreact
there be no render by section in my extension
Question
do you want to request a feature or report a bug what be the current behavior if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below what be the expect behavior which version of react and which browser os be affect by this issue do this work in previous version of react
facebookreact
dev tool chrome component console error get output from backend js
Question
do you want to request a feature or report a bug bug what be the current behavior when I get a component stack trace the log trace come from the dev tool extension image what be the expect behavior I use that trace usually to click and set a debugger so I can debug some react internal
facebookreact
react devtool always launch in chrome
Question
hi I have the extension instal on both chrome and firefox my default browser be firefox each time I try to debug a react native app remotely it launch chrome to use the debugger there how do I change the default browser for devtool to firefox
facebookreact
inline settimeout within the render cause a random number to appear on screen
Question
report a bug the current behaviour be that settimeout inside a render method be produce a random number for no explain reason the number persist after the settimeout have go off and the settimeout still produce the desire effect for example if it be to log something the console it would still do that jsx sample code not the original code in which the problem occur but I be able to reproduce the problem in codesandbox io start of code example style css app font family san serif text align center import react from react import reactdom from react dom import style css function app return hello codesandbox start edit to see some magic happen settimeout console log hello world 3000 const rootelement document getelementbyid root reactdom render rootelement output of webpage hello codesandbox start edit to see some magic happen 5 end of code the expect behaviour be that the settimeout function would produce no trace of any text whilst still work it be present in react version 16 9 0
facebookreact
error could not find node with i d 3742 in commit tree
Bug
describe what you be do when the bug occur 1 2 3 please do not remove the text below this line devtool version 4 0 6 a39d9c3 call stack at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11442 at map foreach at commitindex chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11388 at e getrankedchartdata chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11921 at xi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 277807 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55891 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 98281 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84256 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81286 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25364 component stack in xi in div in div in div in ir in unknown in n in unknown in div in div in wa in ce in be in so in vl
facebookreact
limitation of context api compare to legacy implementation
Question
this isn t technically a bug but a limitation of the new context api implementation and also a question on whether this should be fix by react or if I should implement a custom in house solution instead I have a fairly edgy use case with a component library that provide several parent child component e g tab accordion etc this look like a standard context use case so far however the library have to work in a plugin base environment mean the parent and child component be render by two completely independent app host app and plugin respectively example jsx content thus two separate instance of the component library be create one for the host app and one in the plugin scope but they still have to communicate with each other behind the scene while keep it transparent to the user this work seamlessly with the legacy context api but now with the new one it break that be because react createcontext return an object that now have to be explicitly share between the component by mean of an import but because of the decouple architecture of the app and multiple instance of the library be use this seem impossible to do as state in the doc the legacy context api be deprecate and will be remove in future version of react 17 so I d like to avoid be stick on react 16 when that happen
facebookreact
can t use instance value without ref
Question
I be experiment with migrate some of my class component to hook my use case be explain in detail here but I can quickly explain the idea I have a class component which expose a ready promise since produce a element I guess I can use the useimperativehandle hook to attach ready to the ref I use for the this be no problem however I also have a class component which use react child to collect the ready promise from all its descendant and expose promise all of that array of promise as its own ready value since do not produce any markup of its own and you can t place ref on I don t see how to use useimperativehandle here there s nowhere to attach the ref here be the relevant code tsx export class rendergroup extend react component private promise promise ready promise componentdidmount this ready promise all this promise then render this promise return recursivemap this prop child node if shouldinspect node const originalref node ref return react cloneelement node ref ref mjx if ref return this promise push ref ready if typeof originalref function originalref ref else if originalref typeof originalref object originalref as react mutablerefobject current ref return node function shouldinspect node reactnode node be react reactelement react refattribute return react isvalidelement node typeof node type function node type prototype instanceof mjx export function recursivemap child reactnode fn child reactnode reactnode return react child map child child if react isvalidelement child return child if child in child prop child react cloneelement child child recursivemap child prop child fn return fn child
facebookreact
chrome extension background page and useeffect not trigger
Bug
do you want to request a feature or report a bug bug what be the current behavior when use useeffect from a background page in a chrome extension the body of the effect be not trigger if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem see the demo project here what be the expect behavior useeffect should be trigger which version of react and which browser os be affect by this issue do this work in previous version of react it stop work somewhere between react 16 8 and 16 9 you can change the react and react dom version in the demo project and see that it work as expect in 16 8 workaround for now the issue can be work around as demonstrate l5 so I m not really sure what s go on but perhaps because background page be not actually visually render to the screen then react have optimize thing so that effect be not trigger
facebookreact
error getcommittree unable to reconstruct tree for root 1 and commit 38
Bug
describe what you be do when the bug occur 1 start profile app record and reload page 2 go through profiler commit 3 crush please do not remove the text below this line devtool version 4 0 6 a39d9c3 call stack at d chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 5745 at e getcommittree chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 8527 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 275553 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55891 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62940 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99536 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84256 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81286 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25364 at n unstable runwithpriority chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 4368 component stack in bi in div in div in div in ir in unknown in n in unknown in div in div in wa in ce in be in so in vl
facebookreact
error can not modify filter preference while profile
Bug
describe what you be do when the bug occur 1 2 3 please do not remove the text below this line devtool version 4 0 6 a39d9c3 call stack at n set chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 1 34098 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 261228 at fi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 72851 at vi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 74577 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 93355 at n unstable runwithpriority chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 4368 at kt chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25093 at wl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 91165 at jl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 79859 at m chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 2839 component stack in ma in div in div in div in ga in xa in div in lo in ir in ir in unknown in n in unknown in div in div in wa in ce in be in so in vl
facebookreact
error message when call work commit in commit phase
Question
this be I just toy around with unstable apis I don t know what these can be use for just try to make sense of they from their name do you want to request a feature or report a bug error message of batch commit be confuse what be the current behavior I be experiment with the unstable create sync root apis and just try to piece together what go where while look through the source I find that the work return from createroot have a parameter call oncommit for I this imply it s call after the commit which doesn t seem to be intend l58 however give the code below I get uncaught invariant violation work commit can not commit while already render this likely mean you attempt to commit from inside a lifecycle method js function app return hello codesandbox start edit to see some magic happen const rootelement document getelementbyid root const root reactdom unstable createroot rootelement root render then const batch root createbatch batch render bad batch commit settimeout good batch commit 0 batch then good batch commit three thing I notice 1 seem like I need to call batch commit after the batch be complete change it to batch then good batch commit get rid of the error but I notice that the original code be use throughout the internal test in fact move createbatch and batch commit the batch well after long timeout the initial root render call seem to allow sync batch render batch commit 2 lifecycle should be replace with something different before these apis get stable since we try to get away from this mental model for example apply setstate in componentdidmount synchronously in a batch l143 could be convert to a sync test and still pass while I would ve expect can defer a commit by batch it l132 to fail with the invariant violation from above 3 not all lifecycle be during render as far as I know componentdidupdate be call during commit if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below what be the expect behavior I m basically ask when it s safe to call batch commit during render phase during commit phase outside of these phase e g in some oncomplete callback which version of react and which browser os be affect by this issue do this work in previous version of react react dom 16 9 0
facebookreact
how should we set up app for hmr now that fast refresh replace react hot loader
Question
dan abramov mention that devtool v4 will be make react hot loader obsolete I I have this hook require react reconciler hostconfig injectintodevtool opt but hmr have always work completely without it be this now a new requirement dan yes that s what the new mechanism use the new mechanism doesn t need react hot loader so by the time you update you d want to remove that package it s pretty invasive I can t see any mention of hmr in the devtool documentation however now that react hot loader have become obsolete and with it the require react hot loader root hot method how should we set up app for hmr in react dom app react native app react custom renderer app I d be particularly interested in a migration guide specifically for anyone who s already set up hmr via react hot loader also for hmr do it matter whether we re use the standalone devtool or the browser extension devtool
facebookreact
new plugin not work after change any prop in debugger tool
Bug
do you want to request a feature or report a bug have an issue what be the current behavior not able to see any rendering after change any prop in debug tool and also get below issue image uncaught typeerror can not read property reactinternalinstance of undefined at object get react dom min js format 4200 at a react dom min js format 4937 at object enqueueforceupdate react dom min js format 4965 at s backend js 9 at object setinprop backend js 9 at t backend js 1 at t l emit backend js 1 at backend js 9 at t backend js 1 if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below reproduce bug try to change any dynamic pro in the debugg tool section and you will not able to see any dom change what be the expect behavior whenever change any prop in debugg tool react component should be render as per it it be work fine with previous react developer tool chrome plugin which version of react and which browser os be affect by this issue do this work in previous version of react I be use the below version react 15 6 2 react dom 15 6 2
facebookreact
unable to switch a variable with number type to a string in devtool
Duplicate
do you want to request a feature or report a bug bug what be the current behavior in the devtool component tab if the current value of a state member be a number there be no way to set it to an string you can not type quote if it be of type number and leave it empty do not reset the value if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below 1 create a react component that have an integer value in the state 2 find the state variable and try to type 3 erase the value and copy to the console 4 the value reset to the value it be before these step what be the expect behavior parse value in devtool like the js compiler do for literal value string 0 9 number value array which version of react and which browser os be affect by this issue do this work in previous version of react react v 16 8 6 devtool v 4 0 6
facebookreact
usestate s setstate hang when call in close window
Bug
do you want to request a feature or report a bug bug what be the current behavior if usestate s setstate be call in a closed window it hang the browser at least chrome I agree that this seem like a weird issue but we do this all of the time in our plugin we ve build for an application that have iframe base ui this reproduce it just click do it note that your codesandbox service worker will spin up to 100 cpu and I can t figure out a way to stop it other than to kill that task in the chrome task manager what be the expect behavior no hang it should just ignore the setstate call ideally which version of react and which browser os be affect by this issue do this work in previous version of react 16 9 I m not sure but hook be fairly new this reproduce in chrome 76 but not firefox as far as I can tell
facebookreact
react hook exhaustive dep miss warning when pass a function
Bug
do you want to request a feature or report a bug arguably a bug in eslint plugin react hook what be the current behavior the exhaustive dep rule do not catch the follow case js const foocontext react createcontext meanwhile somewhere deep in the component tree function bar const foo usecontext foocontext useeffect foo return a div walk into a bar what be the expect behavior I think the plugin should suggest add the dependency on foo js useeffect foo foo it already make this suggestion for the verbose form of the code js this code useeffect foo be fix to useeffect foo foo which version of react and which browser os be affect by this issue do this work in previous version of react
facebookreact
devtool v4 breadcrumb be remove
Question
request for feature the old devtool use to show a breadcrumb component hierarchy at the bottom it be really useful to navigate the parent component I couldn t find it on the new devtool do we remove it any reason to remove it will we add it back
facebookreact
error getcommittree unable to reconstruct tree for root 1 and commit 1
Bug
please include repro instruction and example code please do not remove the text below this line devtool version 4 0 5 5441b09 call stack at d chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 5744 at e getcommittree chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 8526 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 51 275512 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62939 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99535 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 at n unstable runwithpriority chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 51 4368 component stack in bi in div in div in div in ir in unknown in n in unknown in div in div in wa in ce in be in so in vl
facebookreact
firefox browser console open randomly blank after instal react dev tool
Bug
hi firefox v68 0 2 react dev tool late version after disable react dev tool same tab work as expect p s this happen mostly on non react tab I just start use react dev tool and I don t know about prev version of firefox or react dev tool btw
facebookreact
devtool typeerror can not read property 0 of null
Bug
do you want to request a feature or report a bug bug what be the current behavior when use the late dev tool v4 0 5 on my project when I inspect react redux element that use connect devtool crash I can t map from my crash to the actual source but the code be react devtool build backend js usememo function e t var n w r null n n memoizedstate 0 e here n exist but n memoizedstate itself be null return v push primitive memo stackerror new error value r r up one level of stack be react function usememo create input var dispatcher resolvedispatcher return dispatcher usememo create input and up one level be react redux l199 const childpropsselector usememo the child prop selector need the store reference as an input re create this selector whenever the store change return createchildselector store store if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below I ll have to try and make a small repro but I hope there s something obvious give the info above it s not clear to I if react redux be do something or if its devtool this behavior exist in v3 and I be hope it d get magically fix with v4 but it remain what be the expect behavior which version of react and which browser os be affect by this issue do this work in previous version of react this be in an electron app w react redux v7 1 0 and react v16 8 3 have to use this due to the version of react native I m on
facebookreact
version 4 remove file location
Duplicate
this technically be a feature a miss one from version 3 on version 3 you could visualize file location which be key in find bug I and my team be currently struggle due to this remove feature on version 4 you should fix this asap as it cost a lot of time now
facebookreact
react devtool not persist setting
Bug
do you want to request a feature or report a bug bug what be the current behavior devtool extension do not persist state for example the welcome dialog display upon every refresh if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below 1 open react devtool in a react app 2 change devtool setting 3 refresh app in browser what be the expect behavior setting should be change which version of react and which browser os be affect by this issue do this work in previous version of react this be in a corporate install of chrome 71 it s possible that it block whichever persistence api react devtool be use chrome devtool itself persist setting successfully
facebookreact
error could not find node with i d 339 in commit tree
Bug
please include repro instruction and example code please do not remove the text below this line devtool version 4 0 5 5441b09 call stack at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11441 at map foreach at commitindex chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11387 at e getrankedchartdata chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11920 at xi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 51 277765 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 98280 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 component stack in xi in div in div in div in ir in unknown in n in unknown in div in div in wa in ce in be in so in vl
facebookreact
devtool scrollbar hide flamegraph
Bug
do you want to request a feature or report a bug bug what be the current behavior scrollbar be cover flamegraph if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below current current without scrollbar there be more graph hide by scrollbar without scrollbar what be the expect behavior scrollbar do not cover flame graph or if flamegraph s height be long enough to use scrollbar flamegraph container s width should shrink about scrollbar width which version of react and which browser os be affect by this issue do this work in previous version of react 16 9 chrome 78 0 3887 7 macos 10 14 6
facebookreact
show property type of value string int etc on state prop
Duplicate
feature what be the current behavior on the new developer tool you be unable to see what property type the value you use to be able to see if the value be a string or int because of the quotation mark for example i d 1 string or i d 1 int both string and int be show without quote what be the expect behavior I want to see if the value inside the prop or state be an string or integer by use quotation mark on the value i d 1 which version of react and which browser os be affect by this issue do this work in previous version of react I m use version 4 0 5 8 19 2019 do this work in previous version of react yes 3
facebookreact
error could not find commit datum for root 1180 and commit 2
Bug
please include repro instruction and example code please do not remove the text below this line devtool version 4 0 5 5441b09 call stack at n value chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 16721 at m chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 51 293849 at al chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 51 294084 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62939 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99535 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 at n unstable runwithpriority chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 51 4368 component stack in al in div in div in ir in unknown in n in unknown in div in div in wa in ce in be in so in vl
facebookreact
error getcommittree unable to reconstruct tree for root 1 and commit 4
Bug
please include repro instruction and example code please do not remove the text below this line devtool version 4 0 5 5441b09 call stack at d chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 5744 at e getcommittree chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 8526 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 51 275512 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62939 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99535 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 at n unstable runwithpriority chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 51 4368 component stack in bi in div in div in div in ir in unknown in n in unknown in div in div in wa in ce in be in so in vl
facebookreact
devtool profiler save profile do nothing on firefox
Bug
hi long time user first time issuer I think I find a bug with the profiler component when I click on the save profile button at the top nothing happen and there appear to be no new file in my download folder I think it might be silently fail and that s why I be not get any response have anyone else run into this issue another thing I would like to mention be that I haven t look through all of the documentation material about the new profiler I only read this introductory blog post so if this issue be address elsewhere I apologize and also request the source to that solution thank you for your time version react devtool 4 0 5 firefox 68 0 2 64 bit ubuntu 18 04
facebookreact
custom hook and strange warning
Enhancement
I ve a question about a behaviour that appear strange to I I be write a custom hook js const usetoggle initialstate const istrue setstate usestate initialstate false const false setstate false const true setstate true return istrue true false it work fine but if I try to rewrite false and true use setstate bind I get the follow warning in console js const false setstate bind null false const true setstate bind null true the warning warn state update from the usestate and usereducer hook don t support the second callback argument to execute a side effect after render declare it in the component body with useeffect be this the expect behaviour why be that the two snippet appear equivalent to I
facebookreact
hook component can not be click in react dev tool if you want it work well
Question
issue type bug issue description look at the code blow it be very very very simple jsx import react usestate from react export default function democounter const fnwrapper usestate fn const count setcount usestate 0 fnwrapper proto setcount s setcount s assign fnwrapper proto setcount to callsetcount const callsetcount fnwrapper proto setcount return count count this do not work if I open react dev tool and click the dom node fnwrapper proto setcount e currenttarget value this always work not matter I open react dev tool and click the dom node or not callsetcount e currenttarget value why callsetcount always work but fnwrapper proto setcount not if and only if after I open the react dev tool and click the dom node please tell I the truth
facebookreact
error could not find commit datum for root 26047 and commit 5
Duplicate
please include repro instruction and example code please do not remove the text below this line devtool version 4 0 5 5441b09 call stack at n value chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 16721 at m chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 51 293849 at al chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 51 294084 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62939 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99535 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 at n unstable runwithpriority chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 51 4368 component stack in al in div in div in ir in unknown in n in unknown in div in div in wa in ce in be in so in vl
facebookreact
error could not find commit datum for root 1896 and commit 16
Bug
please include repro instruction and example code please do not remove the text below this line devtool version 4 0 4 3c6a219 call stack at n value chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 16721 at m chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 293207 at pl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 293442 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62939 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99535 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 at n unstable runwithpriority chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 4368 component stack in pl in div in div in or in unknown in n in unknown in div in div in ha in le in ve in ko in ul
facebookreact
get maximum call stack exceed on backend js when render many element
Bug
detail use version 4 0 2 8 15 2019 I be get a maximum call stack size exceed when my app start up while my app use this be a little different I have replicate the issue use a fresh create react app I will include the app js code below step to reproduce 1 create a new app use version 3 0 1 of create react app 2 replace the code in app js with the code list below 3 inspect the console there should be a stack trace from a maximum call stack exceed error app js import react from react import logo from logo svg import app css const creatediv num const rtn for let I 0 I num I const key div I rtn push return rtn function app return edit src app js and save to reload learn react createdivs 15000 export default app call stack backend js format 2097 uncaught rangeerror maximum call stack size exceed at ge backend js format 2097 at ge backend js format 2435 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 at ge backend js format 2478 ge backend js format 2097 ge backend js format 2435 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 ge backend js format 2478 postmessage async r contentscript js 1 88 contentscript js 1 n contentscript js 1 anonymous contentscript js 1 anonymous contentscript js 1 show 170 more frame this be not an issue in the previous version of react devtool
facebookreact
wrong tab suggestion label in devtool
Bug
the popup that appear when you click on react icon still say react tab will appear to the right but the tab label have change
facebookreact
devtool show component file path
Enhancement
do you want to request a feature or report a bug feature what be the current behavior the new devtool doesn t show the component file path as do the v3 version what be the expect behavior it would be great to show the component file path it s a really important feature when work in a large codebase which version of react and which browser os be affect by this issue do this work in previous version of react react devtool v4 be affect v3 have it
facebookreact
devtool fix or silence can not find fiber with i d warning when hover
Enhancement
sometimes I see can not find fiber with i d when hover over the tree they be sporadic I ll need to dig into why they happen but we also need to look at our usage of warning to make sure they re either actionable or gate by dev debug originally report by gaearon via
facebookreact
devtool commit picker should register leave the picker at a side as set a terminal value
Enhancement
seem non ideal typically range control handle this case screen recording 2019 04 12 at 07 54 pm originally report by gaearon via
facebookreact
devtool too deep tree can cause a stack overflow
Enhancement
with 10 000 item nesting in deeplynestedcomponent case not super realistic but we could fix this by avoid recursion in the traversal originally report by gaearon via
facebookreact
devtool suspense debugger
Enhancement
mvp x initial prototype with a tree and toggle x tree should reflect real suspense state make it less fragile x do finddomnode issue affect this ensure expensive tree construction doesn t run unless you re on the tab improve navigation so the user doesn t get lose maybe flash nodes maybe offer a finder tool sync selection with the component tab make it look nice bvaughn future consider a fuzzer consider filtering by viewport optimize the tree update consider listen to operation don t forget to handle ancestor reorder originally report by gaearon via
facebookreact
devtool element height be clip by console
Bug
clip bug this one be kinda tricky to reproduce but basically the step be 1 click the inspect element and hover any component 2 open the console press esc 3 move mouse back to devtool and click again the inspect button to stop inspection 4 close the console with esc ps sorry for the gif quality I don t know how to properly convert the mov to gif originally report by lucasecdb via
facebookreact
devtool overlay stay after devtool be close
Bug
1 hover over a node so you see its bounding box over the page 2 without move your mouse press cmd opt j to hide the devtool result the overlay stay even if you move your mouse or reopen react devtool expect it disappear originally report by sophiebit via
facebookreact
devtool should be able to add a prop that be not yet set
Enhancement
right now I can inspect a component and edit its prop but I could not find a way to add a new prop that wasn t already set originally report by steveluscher via
facebookreact
devtool improve prop state value editing interface
Enhancement
follow up to a discussion thread on 294 and a messenger chat with gaearon the current ui for edit prop state hook value have a couple of shortcoming string numeric value be sometimes of an unclear type devtool use the correct but this be subtle show e g quotation mark around string could be more helpful null initial value can only become string at the moment devtool do not attempt to parse numeric or boolean value and change the input type if it do we would probably also need to enable a way for you to opt back out of that input type somehow in case it be incorrect field that maybe support multiple type e g string number be lock into a single type whichever type they happen to be initially additional quirk that might be worth iron out non editable string be currently wrap in quotation mark but editable one aren t originally report via
facebookreact
react devtool welcome screen keep show up
Bug
do you want to request a feature or report a bug bug what be the current behavior welcome to the new react devtool message block the devtool panel every time the it be open if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below 1 open a website with react with devtool instal 2 open the component tab 3 dismiss the welcome screen 4 close the devtool and open it again what be the expect behavior dismiss the welcome to the new react devtool message should be permanent which version of react and which browser os be affect by this issue do this work in previous version of react devtool 4 0 5 chrome 77 0 3865 35
facebookreact
name hook mvp support
Enhancement
note this issue be outdate the current thinking be that the alternative load source code with source map and parse for name be probably the good course of action the problem one common piece of feedback about devtool hook integration be that hook have no name and can be confuse consider the following example js function usesomecustomhook const foo setfoo usestate true const bar setbar usestate false function example const baz usesomecustomhook currently in devtool the above component would be display as follow somecustomhook state true state false this information isn t as rich as we would prefer the next question be often can you use the name of the variable the hook return value be assign to but this be tricky because devtool doesn t actually have any way to access that variable even if devtool have a handle on the example function above how would it access the usesomecustomhook function the proposal the solution to this would be some form of user define metadata preferably generate by a code transform building on the precedent of the usedebugvalue hook we might introduce a new no op hook e g usedebugname the above example could make use of this hook like so js function usesomecustomhook const foo setfoo usestate true usedebugname foo inject by babel transform const bar setbar usestate false usedebugname bar inject by babel transform function example const baz usesomecustomhook devtool could then display something like somecustomhook state foo true state bar true implementation detail the new usedebugname hook might be a noop hook provide by react similar to usedebugvalue or it could even be an export from the soon to be release react debug hook package the key concern would be that 1 it have no effect and add no overhead when devtool be not present 2 not call it at all or only call it for some hook should not break or corrupt anything devtool could override the no op usedebugname implementation before inspect a component and automatically associate the provide name with the most recently call native hook for example the follow code should only result in one name hook the second usestate call js const foo setfoo usestate true const bar setbar usestate false usedebugname bar inject by babel transform const baz setbaz usestate true be able to support sparse name metadata would be important for third party code that might not be transform to supply the metadata a code transform would be ideal for this scenario because manual annotation would probably be cumbersome this could also be market as a dev only transform so as not to bloat production bundle with display name we might even try to detect the env and throw if it isn t dev like further consideration custom hook in some case custom hook might also be ambiguous consider the usesubscription hook js function example const foo usesubscription const bar usesubscription currently in devtool the above component would be display as follow subscription some value state object subscription some other value state object maybe the value alone provide by usedebugvalue could be enough to uniquely identify the hook but I suspect in many case it might not be sufficient should we then use usedebugname for custom hook as well I think it would be more fragile give the way our custom hook detection logic be implement custom hook be not identify until after a component have finish render in order for we to associate name with custom hook we would need to maintain a stack of name this could lead to potential mismatch though in the event that usedebugname be call more or few time than there be custom hook for example consider the follow code js function usesomecustomhook const foo setfoo usestate true usedebugname foo usedebugname effectively ignore const bar setbar usestate false const baz setbaz usestate false usedebugname baz the propose implementation of usedebugname would be robust enough to handle name foo and baz state and leave bar as anonymous state hook if we be maintain a stack of name however this discrepency would be more difficult to manage perhaps there be a clever solution to this problem I would probably suggest leave it out of the initial implementation though and only revisit if we determine it s a necessary feature alternative consider pass debug name as an additional unused parameter an alternative approach to call a separate hook for naming purpose would be to pass the display name as an additional parameter to the native hook e g js function usesomecustomhook const foo setfoo usestate true foo const bar setbar usestate false bar function example const baz usesomecustomhook pro less code do not introduce a new hook con it require knowledge about the arity of native hook ror example usereducer have optional parameter that the transform or manual code would need to be aware of to avoid a runtime error it would not be possible to support name custom hook if that s something we decide to do load source code with source map and parse for name we could use an extension api like resource getcontent method resource getcontent to load the source code include custom hook and parse it determine the hook variable name essentially this would work like the propose transform above but at runtime pro do not require a babel transform step just work do not potentially bloat production build if transform be use incorrectly con add additional async load complexity to suspense cache use for hook inspection may have difficulty parse certain code pattern e g babel s destructure transform unless we embed a full parser call tostring on the function component and parse for name a possible 80 20 variant of the above proposal would be to simply call tostring on the function component and parse any top level hook pro do not require a babel transform step just work do not potentially bloat production build if transform be use incorrectly do not require any additional asynchronous code con only support top level hook use directly within the function may have difficulty parse certain code pattern e g babel s destructure transform unless we embed a fullp parser use a babel transform to leave an inline comment and call tostring to search for it rather than insert a call to a new custom hook our code transform could just insert an inline comment with the name we could then parse the code to find the inline comment e g js function example hook foo example react js 3 const foo usesubscription hook bar example react js 5 const bar usesubscription pro do not potentially bloat production build if transform be use incorrectly potentially sidestep difficulty of parse certain code pattern e g babel s destructure transform con only support top level hook use directly within the function still require an explicit transform step originally report via
facebookreact
devtool switch between render at render use keyboard arrow key
Enhancement
my favorite devtool feature why do this render have a remain problem it s too hard to flip through a long list of render in the render at list to find an interesting render I know I can use the mouse or tab and then space to move to the next render but that s painful if there be 50 render to work through suggestion when an item in the render at list have focus then up down arrow should change the select render and scroll the pane up down if the select render isn t visible this would be helpful for accessibility too I ll file a separate issue for keyboard support for the flamegraph view keyboard access to that view will be much hard to implement so it make sense to do it separately originally report by justingrant via
facebookreact
devtool keyboard arrow key navigation for the flamegraph view
Enhancement
it would be good to have keyboard navigation on the flamegraph view to make it easy and fast to scoot around to different component in the same render give that flamegraph be implement in svg and give the complexity of navigate through an uneven grid I suspect keyboard access be probably beyond the scope of near future devtool release but want to file this issue while it s top of mind expect behavior there should be a select focus ui of some sort around the active component this could be a black or colored outline around the currently select component or perhaps a background pattern like diagonal hatch imho this would be valuable even without keyboard support up arrow should change selection to the parent component leave right arrow should move selection to the prev next sible component should wrap when at the beginning or end of the line tab should move focus to the right pane this match behavior of other devtool tab like element shift tab should move focus to the rightmost control in the toolbar currently this be the next commit button this be a companion issue to 332 which ask for keyboard access for the render at list compare to this suggestion 332 should be much easy to implement so I split they originally report by justingrant via
facebookreact
devtool trigger error boundary from devtool
Enhancement
it would be useful to force component into an error state in order to test error boundary similar to how the suspense toggle work originally report via
facebookreact
devtool improve hoc search ux
Enhancement
build on top of 360 we could probably improve the search ux in a couple of way visually indicate when the match be because of a hoc name e g match build in hoc type e g search I should match react memo hocs search f should match react forwardref etc originally report via
facebookreact
devtool don t show context for class without either contexttype or contexttype
Enhancement
don t show context for class without either contexttype or contexttype for class with contexttype change the label to legacy context instead originally report by gaearon via
facebookreact
devtool tooltip appear to be time new roman in firefox
Bug
window firefox image look ok in chrome image originally report by daniel15 via
facebookreact
devtool fully disable 0 14 support
Enhancement
it s confuse that 0 14 or early be in half work state where it display a tree but incorrectly we should detect it and fully disable if it doesn t work or fix it if we go the route of disable support 1 devtool should show a warning message that clearly indicate the version of react isn t support this be probably a good idea for v13 and old anyway 2 devtool should not throw any error originally report by gaearon via
facebookreact
error could not find node with i d 6002 in commit tree
Bug
please include repro instruction and example code simply click on profiler and baam please do not remove the text below this line devtool version 4 0 3 95ffd3c call stack at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11441 at map foreach at commitindex chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11387 at e getrankedchartdata chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11920 at I chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 277079 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62939 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99535 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 component stack in I in div in div in div in or in unknown in n in unknown in div in div in ha in le in ve in ko in ul
facebookreact
react devtool styling override global style
Bug
do you want to request a feature or report a bug bug what be the current behavior this be a very specific case there be some style leak from react devtool if you use it in your own application directly specifically these line l174 l178 if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below it s funny I can give a real codesandbox editor now you can see the styling on the editor element here what be the expect behavior no leak style ideally the would be prefix by an i d or classname specific for the devtool I think this should be possible with the styling use by the devtool I can open a pr to fix this if everyone agree on this fix cc bvaughn
facebookreact
react devtool chrome browser extension option select box be break
Bug
do you want to request a feature or report a bug bug what be the current behavior the select dropdowns don t function correctly and be currently unreadable if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below setting break what be the expect behavior select dropdown option be readable and able to be set correctly which version of react devtool and which browser os be affect by this issue do this work in previous version of react devtool app name version google chrome 76 0 3809 100 official build 64 bit cohort stable react devtool 4 0 4 3c6a219 os window 10 os version 1809 build 17763 678 javascript v8 7 6 303 29
facebookreact
error could not find node with i d 266 in commit tree
Bug
please include repro instruction and example code I get this error when I click rank please do not remove the text below this line devtool version 4 0 4 3c6a219 call stack at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11441 at map foreach at commitindex chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11387 at e getrankedchartdata chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 11920 at I chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 277123 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 98280 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 component stack in I in div in div in div in or in unknown in n in unknown in div in div in ha in le in ve in ko in ul
facebookreact
error could not find commit datum for root 1 and commit null
Bug
repro step 1 profile 2 select a component from the flame graph important 3 click setting 4 toggle hide commit below ms in my case it s 100ms demo repro 2 please do not remove the text below this line devtool version 4 0 2 2bcc6c6 call stack at n value chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 16552 at pl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 293513 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62939 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99535 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 at n unstable runwithpriority chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 4368 at kt chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25092 component stack in pl in div in ml in div in div in or in unknown in n in unknown in div in div in ua in le in ve in ko in fl
facebookreact
error could not find commit datum for root 34 and commit 21
Bug
I try to select a different component from the dropdown please do not remove the text below this line devtool version 4 0 2 2bcc6c6 call stack at n value chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 16552 at m chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 292537 at ml chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 292772 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62939 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99535 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 at n unstable runwithpriority chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 4368 component stack in ml in div in div in or in unknown in n in unknown in div in div in ua in le in ve in ko in fl
facebookreact
devtool v4 standalone script at localhost 8097 fail to load
Bug
do you want to request a feature or report a bug report a bug what be the current behavior the standalone devtool v4 script do not load when we navigate to if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below 1 run react devtool 2 navigate to in a browser what be the expect behavior expect the network call to end and a script to show up which version of react and which browser os be affect by this issue do this work in previous version of react not applicable
facebookreact
devtool v4 error startprofiling not support by this renderer
Bug
do you want to request a feature or report a bug bug what be the current behavior start a profile in react devtool v4 result in a console error and no change from the extension uncaught error startprofiling not support by this renderer at object startprofile backend js 9 at t backend js 1 at t u emit backend js 1 at backend js 9 at t backend js 1 I be on react 16 8 2 I be also use auth0 lock which use react v15 6 2 relevant discussion here as a direct non dev and non peer dependency I suspect that this be cause the bug this dependency exist when we use devtool v3 so I suspect that something must have change in v4 to cause this if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem 1 open a react app 2 install 2 try to profile 3 go to console see error what be the expect behavior profiling should work and not error which version of react and which browser os be affect by this issue do this work in previous version of react these dependency have not change in between devtool v3 and v4
facebookreact
error can not read property iscollapse of undefined
Bug
please do not remove the text below this line devtool version 4 0 2 2bcc6c6 call stack at n value chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 1 29005 at n value chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 1 29131 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 218806 at n t render chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 153564 at ei chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 66077 at ci chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 65872 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99617 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 component stack in n in div in n in div in div in vr in div in div in io in ar in or in unknown in n in unknown in div in div in ua in le in ve in ko in fl
facebookreact
why do devtool chrome extension need access to history
Question
I wake up today and the devtool extension for chrome ask for additional permission more specifically access to history I couldn t find any explanation or reference in the changelog so I open this issue
facebookreact
devtool react devtool tutorial now sh edit prop and state have a bad state
Bug
I don t know who s make the bug so report here I ll move to correct repo if someone help I debug it do you want to request a feature or report a bug bug what be the current behavior please watch below screencast 1 goto 2 change the last listitem prop to iscomplete from false to true 3 click the checkbox in the view to change the state again from true to false what be the expect behavior it should just change the state of that listitem instead it s add 3 more in the list with duplicate key which version of react and which browser os be affect by this issue do this work in previous version of react late react mac chrome version 75 0 3770 142 official build 64 bit
facebookreact
be that possible to get legacy version of react debugger
Question
bug highlight element be no available in ver 4 react debugger feature new version of react develop be good bug sometimes I need legacy version of develop tool I jest need both of they can you provide both of they
facebookreact
error could not find commit datum for root 1 and commit null
Bug
please do not remove the text below this line devtool version 4 0 2 2bcc6c6 call stack at n value chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 16552 at pl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 293513 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62939 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99535 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 at n unstable runwithpriority chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 4368 at kt chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25092 component stack in pl in div in ml in div in div in or in unknown in n in unknown in div in div in ua in le in ve in ko in fl
facebookreact
error could not find commit datum for root 44 and commit 4
Bug
please do not remove the text below this line devtool version 4 0 2 2bcc6c6 call stack at n value chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 16552 at m chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 292537 at ml chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 292772 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62939 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99535 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 at n unstable runwithpriority chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 4368 component stack in ml in div in div in or in unknown in n in unknown in div in div in ua in le in ve in ko in fl
facebookreact
dev tool do not respect zoom level on firefox osx
Bug
currently when use the react dev tool on firefox osx I be unable to change the current zoom level the default zoom level be quite small so even with good eyesight I struggle to read it on a high resolution display it be possible to adjust the zoom level of the firefox dev tool as a whole by focus the panel and use cmd however the react dev tool do not respect this and have no option to switch the zoom level manually as a result the react dev tool extension be unusable on firefox I would imagine this be a big issue for anyone with poor eyesight can we please add some accessibility option or fix this behaviour
facebookreact
react profiler bug error getcommittree unable to reconstruct tree for root 1 and commit 1
Bug
please do not remove the text below this line devtool version 4 0 2 2bcc6c6 call stack at d chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 5744 at e getcommittree chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 11 8526 at ai chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 274200 at ha chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 55890 at bi chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 62939 at xl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 99535 at hl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 84255 at fl chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 81285 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 43 25363 at n unstable runwithpriority chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 56 4368 component stack in ai in div in div in div in or in unknown in n in unknown in div in div in ua in le in ve in ko in fl
facebookreact
useeffect fail to fire when host in display none iframe
Bug
do you want to request a feature or report a bug bug start at react version 16 9 0 what be the current behavior react version 16 8 6 if a react app be host in an iframe and that iframe be in a display none style the useeffect hook would trigger if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below react version 16 9 0 if a react app use this version be host in an iframe and that iframe be set to display none the useeffect hook be never fire a cra app with a very simple useeffect hook be create and host here the static host page be here the codesandbox that have this iframe with display none can be find here what be the expect behavior the useeffect hook should be fire even if the app be host in a display none iframe which version of react and which browser os be affect by this issue do this work in previous version of react firefox chrome edge 77x on mac with react 16 9 0 both fail to run useeffect on this iframe safari with react 16 9 0 do run the useeffect on this iframe ie window or 11 unknown
facebookreact
add priority for all event type
Bug
currently the simple event plugin define a priority for the event but not all event go through the simpleeventplugin that s just one of several eventplugin the remain one now get the wrong priority associate with they e g I think all of these should be discrete change compositionend compositionstart compositionupdate selectionchange textinput these show up too but I don t know if they re even bridge dblclick pointerenter pointerleave flare define its own priority
facebookreact
datum reactroot disappear use react router dom for ssr
null
I m encounter a very strange behaviour which I be not expect such bizarre issue when set up a skeleton of react base ssr application I m wonder why this datum reactroot attribute just automatically vanish once react router dom be apply on here be an example I make that have minimum impact of external library do you want to request a feature or report a bug bub probably what be the expect behavior I m sort of expect attribute datum reactroot be append automatically and consistently here be the codebase client js import react from react import reactdom from react dom import app from app js import route from route import browserrouter as router from react router dom const routectx reactdom hydrate routectx document getelementbyid root client route js import react from react import home from component home import title from component title import browserrouter as router route from react router dom export default return server route js import react from react import staticrouter from react router dom import route from client route import rendertostre from react dom server import home from client component home export default req const content rendertostre return content the final outcome on browser side for the generate dom differentiate accordingly use different version of react current behaviour with react v16 8 x hello this be shanghai team behaviour with react v16 0 0 with the same code base the generate dom be hello this be shanghai team which have the attribute datum reactroot clearly not sure if this be something should be expect or should be something wrong
facebookreact
bug react dom server be mutate css variable name
Bug
do you want to request a feature or report a bug bug current behaviour reactdomserver rendertostre be mutate css variable name that be inline and in the camelcase format into kebab case expect behaviour reactdomserver rendertostre do not mutate the css variable name and keep it in camelcase format demo version issue appear in issue appear in that s all I ve test so far other note it s worth note that reactdom render be preserve the css variable name and not mutate it it only seem to only be an issue with reactdomserver rendertostre
facebookreact
eslint plugin react hook crash when reference argument
Bug
do you want to request a feature or report a bug report a bug what be the current behavior referencing argument from inside an arrow function I e the argument from the near non arrow function cause a crash in the eslint plugin typeerror can not read property type of undefined occur while linte src react tsx 92 at gatherdependenciesrecursively node modules eslint plugin react hooks cjs eslint plugin react hooks development js 1032 21 at visitfunctionexpression node modules eslint plugin react hooks cjs eslint plugin react hooks development js 985 7 at node modules eslint lib util safe emitter js 45 58 at array foreach at object emit node modules eslint lib util safe emitter js 45 38 at nodeeventgenerator applyselector node modules eslint lib util node event generator js 251 26 at nodeeventgenerator applyselector node modules eslint lib util node event generator js 280 22 at nodeeventgenerator enternode node modules eslint lib util node event generator js 294 14 at codepathanalyzer enternode node modules eslint lib code path analysis code path analyzer js 632 23 at node modules eslint lib linter js 752 32 if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below this doesn t reproduce in codesandbox as cra hasn t be update yet this snippet be enough to cause the crash js function usemyhook useeffect argument crash because reference resolve def be empty this however do not crash js function usemyhook useeffect function argument ok return argument also ok it be possible this depend on use the typescript eslint parser parser but I think scope analysis be run internally by eslint so it shouldn t matter what be the expect behavior no crash which version of react and which browser os be affect by this issue do this work in previous version of react react hook exhaustive dep rule
facebookreact
use script in react createelement s type parameter allow you to execute javascript code in the child parameter
Bug
do you want to request a feature or report a bug report a bug what be the current behavior it s possible to execute javascript code write in the child parameter of the react createelement function if the type parameter consist of a string with mixed casing like so javascript react createelement script null alert 1 what be the expect behavior it should not execute the code but behave exactly like if you type in script in lowercase I would argue that this be unexpected behavior judge from the docs jsx prevent injection attack jsx prevent injection attack developer might get the impression that it be generally safe to embed any user input use jsx additionally if you try to execute javascript use script tag it win t work I think developer might get the idea to give user the ability to write their own safe html code in comment and the like by parse their input and convert it to react element jsx also allow you to use dynamic input as tag type apart from the mentioned behavior I m not aware of any other type child combination that would result in javascript code execution without a controllable prop parameter so a scenario where a user can control both of these parameter be most likely the only one where this lead to issue so I think the code below be likely the culprit line 423 please correct I if I m wrong l423 l430 imo it would make sense to convert the type variable to lowercase before compare it to the script string so it work as anticipate even if the casing of the input be user controllable unfortunately I m not familiar enough with the inner working of react to submit a pull request of which I m confident that it doesn t break anything this would be my naive solution for this issue javascript if typeof type string type tolowercase script I d love to hear your thought on this be this behavior actually unexpected and if so should it be fix
facebookreact
flare onpressend not be call on keyup for enter key
Bug
trueadm necolas use a recent build from master I notice that onpressend on the press component be not be call on keyup when press with enter here s an example that reproduce the issue here s the source for this example jsx function application const ispresse setpresse react usestate false const onpressstart setpresse true const onpressend setpresse false return press I step to reproduce 1 focus the button via tab 2 press the button by hold down enter 3 un press the button by release enter onpressend be never call so the pressed state persist if you follow the same step use the space key or the mouse you ll see it work as expect the unit test for this l336 be pass for I with this build which be kinda weird
facebookreact
suspense concurrent mode immediately show fallback when update from onchange
Question
do you want to request a feature or report a bug report a bug or at least try to understand some spooky behavior what be the current behavior I have a simple component which read from a toy suspense enable cache the dummy cache simply wait 100ms before respond to anything the cache key be base on some component state manage with the usestate hook this component be wrap with and render in a react root with concurrent mode enable javascript function myapp let text settext react usestate stuff return datum readcachesuspense text settext b a n a n a s update text from button settext e target value reactdom unstable createroot document getelementbyid root render cause I ain t no fall a back div the component have a text field whose value be set to the current cache key with an onchange handler that update the usestate hook when the text change it also have a button which update the state to some fix string asdf when click click the button do what I would expect the page doesn t respond for a fraction of a second while the data be be fetch and then update with a view of the load data edit the text however for instance type a single letter in the field immediately cause the fallback ui to load and unfocuse the text input this happen even if the settimeout be change to 0ms or requestanimationframe or a setimmediate polyfill rather than directly call settext within the onchange handler if I call it within a settimeout 0 it behave the way I would expect I e without unfocuse the field and loading fallback if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem what be the expect behavior I would expect that it shouldn t really matter whether I m update state from an onchange versus an onclick I would expect that the fallback ui doesn t show up until its max duration be meet which version of react and which browser os be affect by this issue do this work in previous version of react I m use react 16 8 6 I test it on chrome 75 on macos 10 14
facebookreact
usecallback doesn t memoize callback in shallow renderer
Bug
do you want to request a feature or report a bug bug what be the current behavior in shallow renderer the return callback from usecallback be not the same one between two rerendere even though the dependency be the same but usememo will work as expect for example the follow test win t work js function somecomponent const noop react usecallback return const shallowrenderer createrenderer let firstresult shallowrenderer render let secondresult shallowrenderer render expect firstresult toequal secondresult if usecallback return the same callback between two render I think the assertion should pass but the same almost logic will work with usememo in the shallow renderer test suite see l273 l291 if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below I create a branch in and you can run the fail shallow renderer test in diff d9a78422c03941578ae9ba487e8132cb what be the expect behavior usecallback should return the memoize callback when the dependency unchanged even in shallow renderer I try to look into this and I find out that in shallow renderer usecallback just return the original callback argument see l365 l371 but usememo will compare the dependency between render I m not sure if it s intend so it s expect that usecallback will not memoize callback in shallow renderer if it s triage as a bug I m glad to send a pr for this which version of react and which browser os be affect by this issue do this work in previous version of react
facebookreact
infinite lint error of react hook exhaustive dep
Question
first attempt be javascript const setfield args const newform object assign form for let I in args if args hasownproperty I newform I args I setform newform useeffect setautocomplete address current args setfield args I have the error react hook useeffect have a miss dependency setfield either include it or remove the dependency array if I follow what the lint say javascript const setfield args const newform object assign form for let I in args if args hasownproperty I newform I args I setform newform useeffect setautocomplete address current args setfield args setfield I have another error line 58 the setfield function make the dependency of useeffect hook at line 72 change on every render to fix this wrap the setfield definition into its own usecallback hook then I follow the advise again javascript const setfield args const newform object assign form for let I in args if args hasownproperty I newform I args I setform newform const mycallback usecallback setfield useeffect setautocomplete address current args mycallback args mycallback then the error be line 68 react hook usecallback have a miss dependency setfield either include it or remove the dependency array and then the code javascript const setfield args const newform object assign form for let I in args if args hasownproperty I newform I args I setform newform const mycallback usecallback setfield setfield useeffect setautocomplete address current args mycallback args mycallback then the error line 58 the setfield function make the dependency of usecallback hook at line 68 change on every render to fix this wrap the setfield definition into its own usecallback hook be I do something wrong thank
facebookreact
eslint plugin react hook can t call hook on component return from function
Question
wrap a component in a function return the component tl dr javascript export function home return function const item setitem usestate return nothing const root document getelementbyid root reactdom render react createelement home root result in the follow error react hook usestate can not be call inside a callback react hook must be call in a react function component or a custom react hook function however this work javascript export function home const item setitem usestate return nothing const root document getelementbyid root reactdom render react createelement home root
facebookreact
strict mode exclude
null
do you want to request a feature or report a bug feature what be the current behavior react strict mode allow we to wrap component we d like to get check this work great but can become annoying when use 3rd party dependency we can t control the current solution be to wrap small component in strict mode and exclude the 3rd party component the issue here be that we have just increase our work by many multiple if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below n a what be the expect behavior it would be great to have an exclude ignore tag or prop on the react strict mode component this would allow we to generally define a single strict mode component on the application root and then exclude other component as need the idea be similar to how testing framework work you can include file match certain pattern and exclude thing as need example jsx which version of react and which browser os be affect by this issue do this work in previous version of react 16 8 4
facebookreact
understanding act behaviour
Question
I have be try to use act for the first time and have some issue and so I m wonder if my expectation be wrong about what it be suppose to do or if I be do it wrong what be the current behavior the only way I can observe the result of state change I initiate be by use a timeout paste the link to your jsfiddle or codesandbox example below what be the expect behavior what I expect be that by wrap a state change or render operation in act all of the result state change side effect re render will be complete by the time act return so that the operation appear or be coerce to be synchronous I create an example wherein I render a view via unstable concurrentmode in the view I create a usestate hook with a value of 0 after the view be render I use that hook s setter to change its state to 1 below be a log of the step I take show three value at each time seenbyrender the last state value that appear within the render body calculate the last value return from my state update function and seenbyeffect the last value observe from a useeffect I create in the view 1 before act render seenbyrender null calculate null seenbyeffect null 2 after act render seenbyrender 0 calculate null seenbyeffect 0 3 incrementing with act setstate 4 after act increment seenbyrender 0 calculate 1 seenbyeffect 0 5 after timeout seenbyrender 1 calculate 1 seenbyeffect 1 what I be want expect be for step 4 to look like step 5 ie I can somehow test the full consequence of my setstate call which version of react and which browser os be affect by this issue do this work in previous version of react 16 8 6 use unstable concurrentmode
facebookreact
useeffect for synchronize state and prop
Question
hi I have a recur scenario that I ve be struggle with since the good old day of componentwillreceiveprop and now I ve pretty much run into the same issue with hook so I be hope I could get some guidance as to what the idiomatic way of solve this and similar case in react be problem description start point I have a list of item every item have an edit button next to it click it open an editor where one can change all the field and either confirm or cancel confirming would send an api call to save the datum but this part be not relevant to the problem I be have the parent component would render the list with the edit button and have an itemunderedit property that would be null from the start click on edit for a specific item would set the itemunderedit to the click item usecase here be the full example with all 3 solution on codesandbox solution 1 make the editor component stateless and control it take in change handler for every field as prop with the parent track every change this solution appeal to I since I like pure stateful component that be a one to one mapping of prop to html they be simple to reason about etc etc this kind of go against the commonly hear keep your state close to where it be use advice which also seem reasonable since I don t really need to know in the parent what the user be type I be only interested to know when they be do at the end this stateless solution also introduce a lot of prop since I need one event handler per field onnamechange ondescriptionchange in the example but it could as well be 10 field which be a lot of prop solution 2 make the editor component stateful and only get an event when editing be do onconfirm itemtosave or oncancel this seem like the react way and be in line with the advice of keep state close to where it be use since I be only interested to know when the user click confirm a stateful blackbox component that track its own state seem reasonable in order to achieve this however I need to copy my prop to the state which accord to gaearon be a bad idea const name setname usestate prop item name const description setdescription usestate prop item description moreover this solution be buggy from the start since click on edit for a different item doesn t re sync the prop with the state it only work if I close the editor and then reopen it stateful editor1 which bring we to solution 3 solution 3 this one have be one of my big pain point with stateful component in react which be why I prefer stateless component with a state container but those I widely demonize nowadays so I be yet again try to understand the idiomatic react way of do this the old way be to sync in componentwillreceiveprop and later with getderivedstatefromprop now I can do this with useeffect where I specify prop item as the dependency since I want to run it when the item change useeffect if prop item name name setname prop item name if prop item description description setdescription prop item description prop item this seem to work as expect but I get the linter warning react hook useeffect have miss dependency description and name either include they or remove the dependency array react hook exhaustive dep obviously if I be to add those to the dependency list I wouldn t be able to change anything in the input so how come I get this warning summary this be a question in two part first one about an idiomatic solution in react as well as feedback to the react team this scenario be simple and common but it s difficult to know how to implement correctly and safely in a consistent way lift state up and make the problematic component stateless be good advice that solve the problem but every time it seem like a temporary solution it also lead to painful refactoring every time something have to be move around the component tree so rely on it in the long run be extremely brittle the second part of the question be whether the solution with useeffect be viable at all and in this case why do I get the linter warning clearly I want to run it only when a certain prop change be there an edge case where this would result in an unexpected bug
facebookreact
license for source code example tutorial on
Question
what be the license for the tutorial and example on
facebookreact
suspense commit pende tree in concurrent mode under heavy load
Bug
seem similar to minimal repro case to reproduce open in new tab let first item s detail to load and then hold press down you ll likely not always see detail tab flicker and later crash warn in console screen recording 2019 04 26 at 04 29 pm
facebookreact
eslint assignment like foo bar baz x should warn about foo bar instead
Enhancement
js let foo useeffect foo bar baz 43 this ask you to include foo bar baz into dep but this doesn t make sense as you write to it instead it should ask to include foo bar into array if foo be a newly create object in render scope then we might additionally nudge you to useref for it instead because otherwise it win t be share between render
facebookreact
static getderivedstatefromprop do not work same as componentwillreceiveprop
Question
do you want to request a feature or report a bug bug what be the current behavior static getderivedstatefromprop be not a replacement for componentwillreceiveprop if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below what be the expect behavior which version of react and which browser os be affect by this issue do this work in previous version of react 16 hi I m try to implement toasternotificationcard which will be display when a user save an item state item save successfully below be my code I m use componentwillreceiveprop which be depreciate I try static getderivedstatefromprop but it didn t work how can I remove componentwillreceiveprop assume the close button shouldn t be in parent component whichever be call notificationcomponent jsfiddle work example requirement on click of the button show notificationcard on click on close hide notificationcard jsx class notification extend react component constructor prop super prop this state open true componentwillreceiveprop prop this setstate open prop show settimeout this handleclick bind this 8000 handleclick this setstate open false componentdidmount settimeout this handleclick bind this 8000 render if this state open return null return item save successfully this handleclick class test extend react component handleclick this setstate show true render return click reactdom render document getelementbyid container