repository
stringclasses
156 values
issue title
stringlengths
1
1.01k
labels
stringclasses
8 values
body
stringlengths
1
270k
facebookreact
bug hydration mismatch in top component do not cause client render fallback
Bug
we render some markup on the server but on the client due to the bug in our app s code we have a different state and we render nothing instead of our markup in this case react should fallback to client render so it be expect that the server render markup be remove but it s not notice how the server render placeholder be still visible though the console log inside the component state that the visible state be false the problem exist only if this branch happen to be at the very top of the component tree react doesn t even see the mismatch react version 18 2 0 step to reproduce 1 render some markup on the server 2 on client side render it as null link to code example the current behavior mismatch be ignore client s render result be not apply the expect behavior fallback to client s render result mismatch warning be report server render markup be remove
facebookreact
reactdevtool extension doesn t work in private firefox window devtool bug
Bug
website or app reactjs org repro step 1 install the reactdev tool extension for firefox I be run firefox dev edition version 104 0b5 on debian linux 2 allow the extension to run in private window by go to add on and theme ctrl shift a 3 visit any website run a development or production of react in firefox I have test firefox dev edition and firefoxesr 4 open firefoxdevtool and visit the component tab add by the reactdevtool extenstion 5 I have test a local dev build and a production build of react and weirdly it work in non private window but in private window it doesn t see that the page use react 6 below be a screenshot of what I see on both website 7 reactdevtoolsbug how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
devtool bug child can not be add or remove during a reorder operation
Bug
website or app repro step 1 select a palette 2 select to color to view shade 3 go back to the color with the navigation arrow how often do this bug happen every time devtool package automate react devtool extension devtool version automate 4 25 0 336ac8ceb error message automate child can not be add or remove during a reorder operation error call stack automate text at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 26848 41 at bridge bridge emit chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 24626 22 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 24795 14 at listener chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 54959 39 error component stack automate no response github query string automate text can not be add or remove during a reorder operation in title be issue be open be public label component developer tool repo facebook react
facebookreact
bug can t use react dom server from graaljs script engine
Question
context graaljs be a javascript engine like v8 that run on jvm I m try to use graaljs to run react dom and generate server side render page problem the package react dom server use textencoder that be not present in the graaljs engine l107 textencoder be a web standard not a ecmascript javascript standard I can t use reactserverstreamconfignode because graaljs as a generic javascript engine do not include package like util or stream I would like to know if be possible to implement a reactserverstreamconfigengine that use only ecmascript standard feature react version 18 2 0
facebookreact
possible problem with the code
Question
hey there I be look at the code of fiber reactfibercommitwork new js be the file and I realize that the intellisense wasn t work in some part of the code like screen shoot 2022 07 05 at 13 34 39 be it the expect behavior I think that the next case win t be achieve
facebookreact
bug eslint plugin react hook false positive conditional call after foreach
Bug
react version react 18 2 0 react dom 18 2 0 eslint 8 18 0 eslint plugin react hook 4 6 0 step to reproduce 1 open 2 run npx eslint src 3 get the follow error error react hook react usestate be call in function app view that be neither a react function component nor a custom react hook function react component name must start with an uppercase letter react hook name must start with the word use react hook rule of hook link to code example the current behavior give the follow pattern tsx const mycomponent return mycomponent ready const usex return I get the follow error error react hook react usestate be call in function mycomponent ready that be neither a react function component nor a custom react hook function react component name must start with an uppercase letter react hook name must start with the word use react hook rule of hook the expect behavior since mycomponent ready be an actual component I shouldn t get this error
facebookreact
bug hide attribute do not accept string value
Bug
react version react 18 3 0 next 522f47345 20220614 react dom 18 3 0 next 522f47345 20220614 step to reproduce jsx hello react link to code example the current behavior react will turn hide into a boolean attribute and remove until find preview of the dom after react dom render until find the expect behavior react do not strip until find to allow use hide until find in chrome 102 for well seo and accessibility
facebookreact
devtool bug open in editor do not work on firefox
Bug
website or app repro step this happen for any local react app but I ve provide a small cra in case any automation be do 1 visit the locally run app on firefox browser in my case v101 0 1 64 bit 2 set up open in editor url in setting set up open in editor url I use vscode file path 3 on the component pane select any element in the page 4 click on open in editor button actual result nothing happen the link do not open in my editor desire result the link should open in my vscode editor I think the reason why this be happen be because of a firefox bug where window open do not work in extension it be use in inspectedelement js l228 to open the source url accord to the extension should use browser window create for firefox how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
devtool bug with and pnp and yarn react devtool fail to start
Bug
website or app repro step 1 in project use and pnp yarn set version berry 2 yarn add d react devtool 3 yarn react devtool 4 see error uncaught exception typeerror err invalid arg type the path argument must be of type string receive undefined at validatestre internal validator js 120 11 at object normalize path js 1005 5 at contain user zw project pnp cjs 40645 18 at object ppath contain user zw project pnp cjs 40659 32 at ispathignore user zw project pnp cjs 49165 27 at findpackagelocator user zw project pnp cjs 49235 9 at object findpackagelocator user zw project pnp cjs 49527 14 at findapipathfor user zw project pnp cjs 49618 41 at object getapipathfromparent user zw project pnp cjs 49669 36 at require 0 module load user zw project pnp cjs 48576 40 how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
devtool bug commit tree already contain fiber 15 this be a bug in react devtool
Bug
website or app or development link repro step or development link git clone above repo npm run dev locally go to create dummy account with email and pass login to the account start profiler how often do this bug happen every time devtool package automate react devtool extension devtool version automate 4 24 6 0 2c8a1452b error message automate commit tree already contain fiber 15 this be a bug in react devtool error call stack automate text at updatetree chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 25307 19 at getcommittree chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 25240 20 at profilingcache profilingcache getcommittree chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 25768 11 at commitrankedautosizer chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 44121 33 at ii chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 15307 7 at yj chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 16179 7 at wl chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 19178 86 at vl chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 18728 11 at ul chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 18720 23 at jl chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 18704 5 error component stack automate text at commitrankedautosizer chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 44104 34 at div at div at div at settingsmodalcontextcontroller chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 36191 3 at profiler profiler chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 53818 34 at errorboundary errorboundary chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 37712 5 at div at div at themeprovider chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 37884 3 at portaledcontent chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 37914 5 at div at div at div at themeprovider chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 37884 3 at timelinecontextcontroller chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 43126 3 at profilercontextcontroller chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 42571 3 at treecontextcontroller chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 30468 3 at settingscontextcontroller chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 31094 3 at modaldialogcontextcontroller chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 38309 3 at devtool devtool chrome extension dnjnjgbfilfphmojnmhliehogmojhclc build main js 54320 3 github query string automate text tree already contain fiber this be a bug in react devtool in title be issue be open be public label component developer tool repo facebook react
facebookreact
bug potential infinite loop with suspense and error boundary not trigger
Bug
react version latest stable and experimental step to reproduce 1 checkout the follow repo 2 run npm install npm run dev 3 load the browser and observe an infinite loop of component re render rather than the error boundary catch the error I ve add a lot of inline comment about thing that be necessary to trigger this bug in this file note that I be unable to reproduce this bug with code sandbox or create react app it only reproduce when run with next js and only in dev mode maybe it have something to do with next s custom error log behavior unfortunately there s no way to disable this see vercel next js discussion 13387 so I m not sure
facebookreact
devtool bug can not remove node 276 because no matching node be find in the store
Bug
website or app repro step I be try save a randomly generate set of color with match country as an object in the local storage from a context so it doesn t change color after a manual refresh how often do this bug happen only once devtool package automate react devtool extension devtool version automate 4 24 6 ca7a38ae4 error message automate can not remove node 276 because no matching node be find in the store error call stack automate text at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 26518 43 at bridge bridge emit chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 24436 22 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 24605 14 at listener chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 54547 39 error component stack automate no response github query string automate text remove node because no matching node be find in the store in title be issue be open be public label component developer tool repo facebook react
facebookreact
devtool bug overlap flamechart in profiler
Bug
website or app repro step 1 check out 2 open the beta website yarn dev 3 use profiler refresh and profile some but not all commit appear a bit borke how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
bug rendertopipeablestream and rendertostaticnodestream render inconsistency
Bug
the output html file include unexpected in the element when there be both variable and plain text together in html js react component the step be about rendertopipeablestream function and in my project I notice similar inconsistent behavior in rendertostaticnodestream as well altho follow step be use v18 0 v18 1 have same result react version 18 1 0 step to reproduce if you find this step too much I ve already create a fork and attach link to the folk error be in html title element 1 go to ssr example sandbox I get this link from here 2 after enter codesandbox page go to src html js file 3 in line 17 replace title with title 321 4 save the file you may automatically fork this project after save 5 after rebuild in the browser window on the right hand side there be three button on the right side of url box click open in new window 6 check new window title link to code example the current behavior the page title and text in html element be both hello 321 the expect behavior the page title and value in html element be suppose to be hello 321 screen shoot 2022 05 21 at 11 03 26 pm
facebookreact
bug when hydrate it show load forever
Bug
after call hydrateroot the import function be not call it keep show loading react version 18 1 0 link to code example for mock server side render I write content in public index html the current behavior always show load the expect behavior the component should be render after finish loading
facebookreact
recomendation discussion hook base context api
Enhancement
I would like to say that I m impressed with how react hook have revolutionize the react ecosystem and the context api however I see some major inconsistency between how the context be read from and how it be provide maybe we we could use a useprovider context expr dep kind of hook similar to the vue provide function js const isguest createcontext true const status const isguest usecontext isguest return isguest const app const isloggedin setisloggedin usestate false useprovider isguest isloggedin isloggedin return or maybe a more object orient approach js const isguest createcontext true const status const isguest isguest usecontext return isguest const app const isloggedin setisloggedin usestate false isguest useprovider isloggedin isloggedin return I would like to hear what you all think about this if you all think the former syntax be prefer then the createcontext function could be remove entirely and replace with the native symbol constructor
facebookreact
bug with value not match any option result in first option be select
Bug
react version 18 1 0 17 0 2 step to reproduce 1 render one link to code example the current behavior the first option will be mark as select the expect behavior no option should be select be ask for a warning
facebookreact
bug internal react error expect static flag be miss
Bug
react version v18 0 0 react router dom v5 2 1 step to reproduce 1 go to profile page 2 warn internal react error expect static flag be miss please notify the react team link to code example screenshot 2022 04 17 124859 dynamicfilter js component screenshot 2022 04 17 125107 the current behavior the expect behavior
facebookreact
bug event in shadow dom get duplicate when bubble
Bug
event dispatch from inside a shadow root will be handle multiple time while bubble up the virtual dom tree I suspect this be because of event retargete when cross the boundary of the shadow dom react version 17 0 include 18 rc2 step to reproduce click on the button in the code example below the current behavior ondivclicke be call twice per click on the button the expect behavior ondivclicke should only be call once per handle click
facebookreact
devtool bug out of memory randomly on page
Bug
website or app repro step goto the site with the react devtool extension instal after instal this plugin page I notice that chrome start give out of memory error page while visit page with react not all of the time but some time after uninstalle the plugin the error message didn t show up anymore be I the first to experience this be there anything I can supply to help figure out what be go wrong how often do this bug happen often devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
bug typeerror elem nodename tolowercase be not a function
Bug
react version 17 step to reproduce 1 window nodename exist and do not have a tolowercase method 2 an error will be report when the event be trigger such as click on the page image changeeventplugin js image
facebookreact
bug pseudo style don t work properly if react state do not change when click with right mouse button
Bug
I have a button that change background in hover and active state click the button with left mouse button lmb work fine style change as they should but click with right mouse button rmb work fine only if underlying react state be actually change e g different from the previous state react version 17 0 2 step to reproduce 1 open the code example provide below 2 click the click I button with lmb more than 2 time don t move your mouse cursor while click 3 click the click I button with rmb more than 2 time don t move your mouse cursor while click link to code example the current behavior no mater how many time you click with lmb the click I button consistently change its background color to yellow when you hold lmb down and change it back to silver when you release lmb the second time rmb press down the background color of the click I button remain yellow even if you release rmb that be whenever you click it with rmb and the new react state be the same as the previous the button style remain yellow even if you release rmb the expect behavior click the click I button with rmb should respect style regardless of the underlie react state
facebookreact
bug autofocus break inside
Bug
react version 17 and 18 0 0 rc 0 next 27b569969 20220211 step to reproduce 1 render inside 2 execute the showmodal method of the dialog 3 you will notice that react will not set focus to the correct input element dialogautofocus link to code example the current behavior in chrome and safari tp the element with autofocus true will receive focus however the element with autofocus true will not receive focus the expect behavior from the html spec the autofocus attribute the autofocus content attribute allow the author to indicate that an element be to be focus as soon as the dialog the dialog element within which it find itself be show from the autofocus global attribute be a boolean attribute indicate that an element should be focus on page load or when the that it be part of be display therefore autofocus true should also set the focus similar to autofocus true for element inside
facebookreact
reset button on io time input do not return correct event value
Bug
react version react 17 0 2 io version 14 bug for io safari and chrom the reset button function do not work on the time input if I change time to 00 31 reset directly the time jump back to 00 30 but the computer still show 00 31 when press reset on a time input the onchange event be not fire reset link to code example pls try on io
facebookreact
bug eslint react hook exhaustive dep when a property be access with and without optional chaining exhaustive dep code suggestion will introduce an error
Bug
step to reproduce stackblitz demo I ve enable enabledangerousautofixthismaycauseinfiniteloop so you can run npx eslint fix index js and see the change that react hook exhaustive dep make through the code suggestion api the current behavior when you accept react hook exhaustive dep code suggestion the follow code js import usestate useeffect from react export function mycomponent const one usestate 1 const foo usestate undefined useeffect console log one if foo bar console log foo bar one useeffect console log one if foo bar console log foo bar foo bar return null will be incorrectly fix to the follow js import usestate useeffect from react export function mycomponent const one usestate 1 const foo usestate undefined useeffect console log one if foo bar console log foo bar foo bar one useeffect console log one if foo bar console log foo bar foo bar one return null the expect behavior react hook exhaustive dep should be recommend the follow js import usestate useeffect from react export function mycomponent const one usestate 1 const foo usestate undefined useeffect console log one if foo bar console log foo bar foo bar one useeffect console log one if foo bar console log foo bar foo bar one return null additional detail when you include both an optional chaining usage foo bar and a non optional chaining usage foo bar exhaustive dep will use the version without the optional chaining for the deps array I e it will recommend a dep array contain foo bar which because foo may be undefined and the deps array be outside will result in a silent runtime error in js or a typescript error in ts if you only use foo bar it will recommend foo bar so this may be an order of usage issue I e prefer the last usage I haven t check however that be a problem because the most common reason to access the same property with and without optional chaining be a case where you have an if condition which implicitly guarantee that the member you use optional chaining on be not nullish and can be access directly and thus do not need optional chaining within the if condition s body and in that case the version without optional chaining will always be the latter usage when you be already use foo bar will not try to autofix that however this be make bad of an issue because if you be already use the correct version and you accept exhaustive dep change to fix a different issue you add a new unrelated variable it need to add exhaustive dep will override your foo bar dep and turn it into foo bar if exhaustive dep see multiple version of the same property access it should recommend the version with the most optional chaining usage since anything less would create an error which would result in the optional chaining usage never even run
facebookreact
devtool bug inconsistent enforcement of use hook in callback
Bug
website or app repro step the rule for hook linter seem to be apply rule about use hook in callback inconsistently use a hook in this callback be okay const usenamed async usequery and subsequently send it as a prop be also okay however assign the anonymous callback directly in the prop trigger the linter rule react hook can not be call inside a callback usequery I m have trouble understand the difference they appear to be equivalent code but with different result from the linter in which case be the linter correct sandbox here how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
devtool bug can not add node 1 because a node with that i d be already in the store
Bug
repro step react 17 0 2 react native 0 66 3 react devtool 4 22 0 react navigation devtool 6 0 5 react navigation bottom tab 6 1 0 react navigation core 6 1 1 react navigation element 1 3 0 react navigation native 6 0 7 react navigation native stack 6 3 0 react navigation router 6 1 0 react navigation stack 6 1 0 how often do this bug happen every time devtool package automate react devtool core devtool version automate 4 14 0 d0ec283819 error message automate can not add node 1 because a node with that i d be already in the store error call stack automate text at application react native debugger app content resources app asar node modules react devtool core dist standalone js 48 140545 at c emit application react native debugger app content resources app asar node modules react devtool core dist standalone js 48 89515 at application react native debugger app content resources app asar node modules react devtool core dist standalone js 48 90986 at application react native debugger app content resources app asar node modules react devtool core dist standalone js 48 347787 at array foreach at s gc e onmessage application react native debugger app content resources app asar node modules react devtool core dist standalone js 48 347771 at s n application react native debugger app content resources app asar node modules react devtool core dist standalone js 40 3009 at s emit event js 315 20 at e export p application react native debugger app content resources app asar node modules react devtool core dist standalone js 8 9318 at e export emit event js 315 20 at e export datamessage application react native debugger app content resources app asar node modules react devtool core dist standalone js 8 15409 at e export getdata application react native debugger app content resources app asar node modules react devtool core dist standalone js 8 14651 at e export startloop application react native debugger app content resources app asar node modules react devtool core dist standalone js 8 12066 at e export write application react native debugger app content resources app asar node modules react devtool core dist standalone js 8 11421 at dowrite stream writable js 403 12 at writeorbuffer stream writable js 387 5 error component stack automate no response github query string automate text add node because a node with that i d be already in the store in title be issue be open be public label component developer tool repo facebook react
facebookreact
devtool bug can not remove node 612 because no matching node be find in the store
Bug
website or app proprietary repro step overall testing and refactoring of a component contain a formik wrap form which include a fieldarray with yup schema use vs code to serve the react js application unable to share the repo website as it be proprietary task log in to the app to see the form as the specific user role require to see the component test yup schema on formik element touch property to do some custom error connection in the contain component with react developer tool open to the component view with the console also open I be verify the element describe in the schema file be get touch and be refine a select in yup schema js file switch one element s schema property from yup object to yup int trigger the error this be a syntax error should be yup number but switch the two cause it all to crash formik 2 2 6 prop type 15 7 2 react 17 0 2 react router dom 4 3 1 react select 4 3 0 yup 0 26 10 yarn 1 13 0 babel eslint 10 1 0 how often do this bug happen every time devtool package automate react devtool extension devtool version automate 4 23 0 e28a0db22 error message automate can not remove node 612 because no matching node be find in the store error call stack automate text at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 26349 43 at bridge bridge emit chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 24415 22 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 24581 14 at listener chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 54033 39 error component stack automate no response github query string automate text remove node because no matching node be find in the store in title be issue be open be public label component developer tool repo facebook react
facebookreact
devtool bug incorrect source location after hot reload edit prop
Bug
website or app repro step 1 create a new react app use create react app 2 replace the code in app js with app jsx in the gist 3 start the app and inspect the 3 p element use dev tool 4 should observe correct line number app js 4 app js 5 app js 6 5 in code editor change the first p element to be multiline like app update jsx in gist 6 after hot reload should observe update line number app js 4 app js 7 app js 8 7 use dev tool change the first p element s child prop to be something else 8 should observe incorrect line number revert to app js 4 app js 5 app js 6 9 repeat step 7 again and should observe correct line number again 10 the line number be observe to be alternate between correct incorrect state when repeat the edit step how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
devtool bug devtool script serve over insecure connection cause issue with local https server
Bug
website or app repro step hi react team I be try to use the devtool to debug in safari I m work with apple pay so I m use ngrok to create a secure tunnel when I visit the ngrok domain safari throw a warning state block the page at be not allow to run insecure content from repro step 1 clone and install dependency 2 run use ngrok or other method for https 3 visit the page use safari 4 inspect the page and you ll see the warning thank you guy how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
devtool bug react dev tool fail to render prop and state of component
Bug
website or app repro step 1 goto 2 start inspect component 3 issue happen on some component not all from 2021 12 31 13 28 10 png w 800 url 4 also in browser console this get report 5 react devtool backend js 12847 uncaught domexception block a frame with origin from access a cross origin frame at export iselement chrome extension fmkadmapgofadopljbjfkapdkoienihi build react devtool backend js 12847 51 at getdatatype chrome extension fmkadmapgofadopljbjfkapdkoienihi build react devtool backend js 1051 65 at dehydrate chrome extension fmkadmapgofadopljbjfkapdkoienihi build react devtool backend js 3487 82 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build react devtool backend js 3639 26 at set foreach at dehydrate chrome extension fmkadmapgofadopljbjfkapdkoienihi build react devtool backend js 3637 91 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build react devtool backend js 3639 26 at set foreach at dehydrate chrome extension fmkadmapgofadopljbjfkapdkoienihi build react devtool backend js 3637 91 at cleanforbridge chrome extension fmkadmapgofadopljbjfkapdkoienihi build react devtool backend js 1506 93 how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
react fiber for the profiler dev tool
Question
I m curious on the reason why use a react fiber be necessary for the react dev tool s profiler
facebookreact
react 18 add commiteffect begin and complete hook expose to customize renderer to improve render performance
Enhancement
if develop a customize renderer for kind of rn framework it can not access the exact begin and finish time of commiteffect commitmutationeffect which be a good timing to send batch of node operation to native we have to collect all placement such as appendchild insertbefore removechild commitupdate in an extra task promise or settimeout to implement real batch update for native side result in low render performance 22946 be the pr
facebookreact
bug render content inside an iframe use createportal with firefox be blank
Bug
I m try to render jsx content inside an iframe use createportal it work fine in edge chrome but in firefox the iframe body stay empty react version 17 0 2 step to reproduce 1 render an iframe 2 use createportal inside the iframe with an element I e test link to code example the current behavior in firefox the iframe content show for like 300ms then go blank the expect behavior it should show content we pass use createportal
facebookreact
devtool bug they make firefox s debugger unusable can t continue or step over
Bug
website or app repro step it s really easy to reproduce by open a simple page in firefox 93 in my case html because in a sandbox firefox behave even more erratically the step 1 open the page open the firefox s dev tool refresh it stop on the first debugger statement 2 press f8 continue or f10 step over and now there be sign that the debug session end no current line continue button change into pause button and that it go on stop load this page button doesn t change into reload current page button the loading page spinner be well spin all in all the debugg doesn t respond to key or button press to give you a glimpse of what it look like sometimes it help to step into and out of the debugger statement instead of f8 f10 after that it work but not always when I disable the extension it work without any trick take I a while to figure out I try disable everything but react dev tool and restart firefox no difference how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
timeline nest update warning logic flaw
Bug
timeline show the follow nest update warning when a synchronous update cause an event handler to run long a big nest update be schedule during layout nest update require react to re render synchronously before the browser can paint consider delay this update by move it to a passive effect useeffect this warning be intend to encourage developer to move heavy update from layout effect into passive effect so that they do not block paint or stretch event handler unfortunately this warning currently do not handle a few case well 1 passive effect might be flush synchronously along with their update if a layout effect schedule a synchronous update 2 click event now always flush passive effect synchronously see issuecomment 811296789 this mean that the current warning may be confusing or misleading we should either update it to ensure that it never fire for update that be already schedule inside of a passive effect or if that be not possible we should remove it entirely
facebookreact
devtool bug chrome extension s setting reset after every reload
Bug
website or app chrome 95 0 4638 69 official build 64 bit devtool version 4 21 0 2f8f60ca8 repro step 1 open chrome dev tool 2 switch to component or profiler tab 3 select setting and change for example highlight update when component render 4 reload window 5 get back to setting checbox be not check expect behavior be to preserve setting forever local storage or at least between reload how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
bug parent ontoggle handler call when child ontoggle handler be trigger
Bug
react version 17 0 2 step to reproduce 1 declare a element nest inside another element 2 add a handler for the ontoggle event for each element 3 toggle the nest element 4 observe that its handler and its parent s handler be both call link to code example the current behavior the ontoggle event for child element trigger handler for parent element this behavior do not occur in normal dom environment the expect behavior the ontoggle event should only trigger its own handler
facebookreact
devtool bug component without own dimension not highlight at all
Bug
website or app repro step create a fix element with an absolute child like this js return popover on top of that implement raf loop update the point in such a scenario the root div get constantly rerendere but no highlight be draw on the canvas or rather it be draw here l49 but its dimension be 0x0 so nothing get highlight from the user perspective if you believe this be an issue I would gladly work on a fix I m unsure what would be the proper fix here my idea be those 1 either introduce more heuristic for measure node in this function l135 l143 2 or always draw at least 2px x 2px highlight cc bvaughn how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
bug fail to execute insertbefore on node and fail to execute removechild on node with chrome translate
Bug
js const oneshow setoneshow usestate false const twoshow settwoshow usestate true return oneshow setoneshow true twoshow settwoshow false edit by bvaughn to add translation this code will trigger the error of insert and delete node after google translation please choose to translate into non chinese
facebookreact
bug the above error should appear after the error message but appear before for some error
Bug
react version both late 17 0 2 and next 18 0 0 alpha 9c8161ba8 20211028 step to reproduce 1 render hello to trigger the input be a void element tag error link to code example the current behavior two log line appear 1 the above error occur in the component 2 input be a void element tag image the expect behavior they should be in the other order 1 input be a void element tag 2 the above error occur in the component this problem doesn t occur in the same way if a component throw an error presumably this go through a different error handling path because it come from the host config if someone work on this you may also want to review look at this issue at the same time 18101
facebookreact
react 18 internal react error if throw on hook cleanup function
Bug
run the follow test javascript import react useeffect from react import create from react test renderer const boom useeffect return throw new error boom return null it print an error to the console on next be fine on late const re create re unmount I ll get the follow error message console error warn internal react error attempt to capture a commit phase error inside a detach tree this indicate a bug in react likely cause include delete the same fiber more than once commit an already finish tree or an inconsistent return pointer the test will pass but consider the nature of the message and that it differ from late I think report it might be a good idea repo if you need it
facebookreact
devtool can t load component tree in component tab
Bug
summary there s a mix of several different issue that result in the component tree not be able to load which happen inconsistently in some case after try out a different build of devtool with a potential fix the issue seem to fully resolve itself even after go back to use the bad build where the issue originally occur however that doesn t mean the issue be fix by that build since other report keep occur this issue be a master task track all of the issue we ve see so far from user report can not add node x because a node with that i d be already in the store report in 21636 before we ship v4 20 0 no location name for view with i d report in the console inspecting devtool itself image invalid renderer i d 1 log in the console of the main page image unable to find react on the page which suggest that the extension fail to load entirely as that s just placeholder text from before the extension panel be create with chrome image uncaught error extension context invalidate report in 22577 navigate to a new tab doesn t load component tree even after v4 21 0 w duplicate extension logic revert see for detail image no error be show at all as also report in 22577 root cause and fix the suspect root cause be the change ship in v4 20 0 for detect duplicate installation of devtool a fix be attempt with v 4 20 2 base on report from user in 22636 confirm that our change in 22597 fix the issue the logic be now be fully revert in
facebookreact
devtool bug hook name fail to parse if source file for component be an html file
Bug
when test our fixture in safari fixture devtool standalone index html with the standalone build if devtool I notice that we be unable to parse hook name because the source file where the component be define isn t a javascript file and instead an html file as in index html which contain html code and some js inside script tag so the babel parser fail to parse the file specifically javascript parsesourceandmetadata js const originalsourceast withsyncperfmeasurement babel parser parse originalsourcecode parse originalsourcecode sourcetype unambiguous plugin jsx plugin in the above code the call to parse fail because originalsourcecode be actually html with js inside like todo list and parse expect actual js code devtool should handle the case when source file aren t js file and still be able to extract out the hook name or fail more gracefully as of 22320 we log to the console a slightly well error message when this happen as oppose to an obscure parse error repro step 1 run standalone app 2 open fixture file in safari fixture devtool standalone index html 3 try get hook name observe that parse source file fail
facebookreact
bug rule of hook should not allow pass a hook as a function argument
Bug
see fail test in even if the pr get stale we should implement this check because currently it let you circumvent the rule
facebookreact
be there any action license should be take grant for conduct a react conference
Question
hello there I m think of conduct a conference relate to react in my country such as the conference list in the follow page in react docs be there any license I should receive from react s side or it be totally free to do that with no permission license
facebookreact
bug nest reactdomserver rendertostre call cause react hook to throw invalid hook exception
Bug
when you make a nest reactdomserver rendertostre call I e call reactdomserver rendertostre from within a component render use reactdomserver rendertostre you can not use any hook after the second call custom hook work but react hook throw a invalid hook call error not sure if this be an acceptable use case for reactdomserver this be how a current project be setup I be just make some additional hook call and encounter this error I have replicate the issue on a fresh react app with nothing else react version 17 0 2 step to reproduce 1 createa a component componenta 2 in componenta make a call to reactdomserver rendertostre and then use a react hook usestate usecontext etc 3 in the main app render componenta via reactdomserver rendertostre reactdomserver rendertostre link to code example the current behavior throw an invalid hook call exception the expect behavior work as usual hook work as normal
facebookreact
feature request eslint plugin react hook no ref check display error when use useref s return value as condition
Enhancement
not sure whether this belong in eslint plugin react hook or eslint plugin react but a contributor at the latter suggest this to be a more appropriate place I ve open an issue instead of an rfc to discuss whether this be the appropriate place issuecomment 899689312 I start migrate a codebase from class base to function base and come across some silliness I have completely miss convert some of the ref check diff const thing this thing const thing useref prop thing I miss this if thing if thing current typescript consider useref prop thing to be perfectly valid since it may be test for non existence of the value even if it be not boolean however due to the rule of hook this value will never be undefined any check for it be unnecessary and could either be an innocuous useless check or indicate a serious bug typo thus I m think it might make sense to make sure a useref s return value be never use as a boolean or condition at the react linter level not sure if it s possible with eslint but if so it could be a very useful rule which would catch a lot of bug
facebookreact
devtool bug react profiler flamegraph section overflow and not resizable
Bug
website or app repro step note the url I link be not relevant and only mean to make the bug report submit pass previously close here since I couldn t find any production site with a development build so I don t think it make sense to outright fail bug report for react profiler relate issue actual bug report I have a page that have lot of component so the component tree be pretty long when I profile on it the flamechart just overflow by default and I have to put it fullscreen to see the why do this render side bar image how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
devtool bug can not hover click element after scroll
Bug
website or app repro step 1 disable any component filter 2 scroll component tree 3 hover any element how often do this bug happen every time devtool package automate 1d2528097 devtool version automate 4 16 0 error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
devtool bug react devtool on firefox initially show an empty blank component tree
Bug
website or app repro step 1 go to any site build with react js 2 open the react devtool from the firefox developer tool window 3 there will be an empty component when component tab be select 4 now refresh the page to see the component tree get populate inside the component tab window version window 10 21h1 firefox version v90 0 2 64 bit attach a gif of the issue while visit reactjs org o7vsagsc5l how often do this bug happen every time devtool package automate no response devtool version automate no response error message automate no response error call stack automate no response error component stack automate no response github query string automate no response
facebookreact
question react support performance answer
Question
react version 15 7 step to reproduce do react have a performance bottleneck on the cpu 2 g gpu 70 m virtual machine for build large and complex web application and the model of gpu and cpu be before 2010 if you use react to develop large and complex application it be recommend to run it on what machine configuration link to code example the current behavior the expect behavior
facebookreact
devtool indicate or print which element cause suspense fallback
Enhancement
in a deep component tree we sometimes modify a deeply nest component to use suspense but fail to wrap suspense at a suitable place this cause the root suspense into fallback and be hard to location where this fallback be introduce whether a component be throw promise be an implicit convention of component this be not detectable by any static analyzer so in a complex app this miss suspense issue can happen frequently I ve test error boundary but they can not catch promise maybe devtool can provide functionality to report where promise be throw
facebookreact
bug radio and checkbox control check property be not update when browser restore form state
Bug
react version 17 0 2 step to reproduce 1 add a textbox two radio button or checkboxe control the check property with state and a button type submit 2 check off the second item banana 3 enter text into the your name textbox 4 right click on the tab and duplicate it alternative close re open the tab or navigate away to a different page and go back javascript function app const fruit updatefruit usestate apple const name updatename usestate function onfruitchange e const newfruit e target value updatefruit newfruit function onnamechange e const newname e target value updatename newname return apple banana preferred fruit fruit apple apple banana your name name save link to code example important this codesandbox win t work because the browser will be too early when restore the form state transpiling be too slow I suggest take this script to a local server to confirm that the browser be able to properly restore form state when load the page the current behavior the banana radio be check and prefer fruit apple be show the react state have fruit apple but the browser have the opposite state I ve confirm that this behavior happen with input type checkbox too the expect behavior to match the behavior of other control input like the textbox apple radio should be check and prefer fruit apple should be show the input check property isn t be sync relate issue I m not use ssr though maybe relate but I m not use defaultchecke similar issue
facebookreact
bug picture element fail to update to appropriate source image on window resize in safari
Bug
use safari 14 0 3 on macos big sur 11 2 2 element render use react fail to update to the correct image source when the window be resize if fix this bug would be consider a good first ticket and some guidance be provide I d be happy to fix it react version 17 0 2 step to reproduce 1 resize window across picture s breakpoint 768px link to code example the current behavior the first image render use react continue to render the initial source image the expect behavior the first image should behave the same as the second render statically inside index html and switch to the correct source image when a media condition apply
facebookreact
devtool bug child can not be add or remove during a reorder operation
Bug
website or app repro step 1 click next day button or prev day button 2 normally there be only three column for three day but you can see the fragment of other column with error message how often do this bug happen every time devtool package automate react devtool extension devtool version automate 4 13 5 0ae5290b54 error message automate child can not be add or remove during a reorder operation error call stack automate text at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 21301 41 at bridge bridge emit chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 19286 22 at chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 19446 12 at listener chrome extension fmkadmapgofadopljbjfkapdkoienihi build main js 37413 39 error component stack automate no response github query string automate text can not be add or remove during a reorder operation in title be issue be open be public label component developer tool repo facebook react
facebookreact
inconsistent crossbrowser onbeforeinput paste event behavior
Bug
react version 17 0 2 in chrome pasting trigger onpaste and onbeforeinput with the nativeevent s clipboardevent and textevent respectively in firefox pasting only trigger onpaste with nativeevent paste if I m not mistaken this seem to be the code responsible for not trigger onbeforeinput on native paste event l328 l331 react version 17 0 2 and 18 0 0 17 0 2 18 0 0
facebookreact
bug webpack process and setimmediate polyfill interfere with time slice
Bug
here s the copy paste of the polyfill this reproe with old cra e g I see this on this branch the result be concurrent render get group into a huge blocking task not sure why yet
facebookreact
bug firefox and react dom cause null access property
Bug
react version 17 0 2 step to reproduce 1 create a component with a state 2 add element add conditionally from state 3 add a complex component like input textarea select iframe etc inside the element add conditionnaly 4 open firefox and drag a file above the zone fast enough and then come back to the complex element it might be really hard to trigger so I suggest to drag around really fast link to code example codesandbox minimal with the maximum of detail I have reproduction ts const fileinput react fc const filezone useref null const drag setdragging usestate false useeffect const handler dragenter setdragge true dragleave setdragge false const div filezone current as htmldivelement object entry handler map key value div addeventlistener key value return if div object entry handler map key value div removeeventlistener key value filezone return drag drop here drop here or search here I use the dragevent to trigger the state but I think anything fire setstate fast enough can reproduce this while this seem the most usable way to reproduce the current behavior when drag a file over the zone fast enough and come back to the complex element it trigger an error 16 38 47 408 uncaught typeerror can t access property reactfiber 6wig1bzlbmp of null react 3 unstable runwithpriority scheduler development js 468 react 12 tsx index tsx 6 tsx main chunk js 263 webpack 7 react dom development js 10578 react 3 bind applyfunctionn self host 1376 dispatchevent self host 1339 unstable runwithpriority scheduler development js 468 dispatchuserblockingupdate react bind applyfunctionn self host 1376 dispatchuserblockingupdate self host 1339 react 4 foreach self host 4356 react 7 tsx index tsx 6 tsx main chunk js 263 webpack 7 screenshot of error first one be firefox normal and second one be firefox developer edition firefox on windows firefox developer edition on archlinux the expect behavior react shouldn t trigger an error
facebookreact
bug in a specific environment control input trigger onchange twice
Bug
on chrome of windows control input change the value in onchange and enter ime mode non letter will trigger onchange twice react version 17 0 2 16 will also window 10 chrome 90 0 4430 85 step to reproduce 1 the input method be adjust to chinese ime 2 enter non letter special symbol such as link to code example the current behavior onchange call twice the expect behavior onchange call correct time
facebookreact
bug eslint react hooks rule of hook false positive when codepath count exceed number max safe integer
Bug
react version 16 14 0 eslint plugin react hook version 4 2 0 eslint version 7 24 0 typescript eslint parser version 4 17 0 babel eslint parser version 7 13 4 a false positive from rule of hook specifically the call conditionally report crop up in a codebase I work on this week it be a very strange scenario where modify portion of arbitrary logical expression operator would change which hook be report or make the lint start pass altogether when nothing about the structure of hook have change I drill into it and diagnose it as an overflow in the lint rule s path count logic please find an isolated reproduction and brief writeup in this repository step to reproduce 1 clone 2 run yarn repro link to code example the current behavior the useeffect hook on repro tsx 7 be flag by rule of hook as be call conditionally the expect behavior no error be raise by the rule of hook rule for repro tsx
facebookreact
bug eslint react hook exhaustive dep rule false positive on constant make with constant expression
Enhancement
react version 16 14 0 17 0 2 step to reproduce 1 create a constant variable with an expression make of only constant 2 run eslint code example jsx const a 1 const b 2 3 const c 1 const d 1 useeffect void a void b void c void d codesandbox the current behavior I see the follow eslint warning react hook useeffect have miss dependency b c and d either include they or remove the dependency array react hook exhaustive dep the expect behavior I see no warning in my example the a variable be skip in the eslint warning but not the other three variable even those they be all constant expression
facebookreact
bug io voiceover announce stale content in heading
Bug
react version 17 0 2 step to reproduce 1 go to use io enable voiceover 2 swipe to first not click h2 observe voiceover read content correctly 3 click the first click I button 4 move voiceover s focus back to first h2 which be now click 5 voiceover incorrectly read it as not click heading level 2 6 swipe to the second not click h2 observe voiceover read content correctly 7 click the second click I button 8 move voiceover s focus back to second h2 which be now click 9 voiceover correctly read it as click heading level 2 link to code example the current behavior voiceover read the first h2 as not click heading level 2 see attach video for more detail the expect behavior voiceover should read the first h2 as click heading level 2
facebookreact
bug radio checkbox input not trigger when set state in listener on a parent element
Bug
hello I want to highlight a div after click on it and hide the highlight after click anywhere else so in componentdidmount I add two event listener on the div and on the window object the problem be kind of wild when I use setstate in a listener add in componentdidmount radio button be not trigger when the listener do not use setstate or use settimeout this setstate 0 radio button work expectedly when create a code example I also try checkboxe and they do not work as well but for example button input work expectedly react version 16 13 1 in my app 17 0 2 in code sand box issue be in both of they step to reproduce you can use this prepared code example the example also show other listener set up which work expectedly current possible workaround as mention early we can use settimeout this setstate 0 to gain expect behavior but it be not a bug fix
facebookreact
react devtool inline package now have react experimental dependency
Bug
I recently update devtool to use the new experimental getcachefortype api 20548 which work well for the browser and standalone extension version because they bundle their own version of react the experimental release this have leave the react devtool inline package use by e g code sandbox in an unreleasable state though until the new suspense apis be release as stable perhaps I could go back to the last commit prior to 20548 and do one final release but then I will be block
facebookreact
bug react test trigger mouseout event for disabled button
Bug
react version 16 14 0 step to reproduce 1 create a test file in a react project and paste the follow code 2 run the test 3 the test for onmouseleave event fail javascript import act from react dom test util import react usestate from react import reactdom from react dom const counter const increasecount setcount prev prev 1 const count setcount usestate 0 return you click count time click I describe button with react test util let container beforeeach container document createelement div document body appendchild container aftereach document body removechild container container null it should not trigger onclick when button be disabled act reactdom render container const button container queryselector button const label container queryselector p act button dispatchevent new mouseevent click bubble true expect label textcontent tobe you click 0 time it should not trigger onmouseenter when button be disabled act reactdom render container const button container queryselector button const label container queryselector p act button dispatchevent new mouseevent mouseover bubble true expect label textcontent tobe you click 0 time it should not trigger onmouseleave when button be disabled act reactdom render container const button container queryselector button const label container queryselector p act button dispatchevent new mouseevent mouseout bubble true expect label textcontent tobe you click 0 time the current behavior the expect behavior all test should pass
facebookreact
bug react devtool fail when use react native herme
Bug
react version 16 13 1 react devtool version 4 10 1 3a8c04e3b2 step to reproduce 1 npx react native init myapp template react native template typescript 2 set enableherme true in android app build gradle 3 start metro bundler via yarn start 4 launch app in android emulator via yarn android 5 launch react devtool 6 reload metro bundler 7 click on any element in the react devtool component view 8 right react devtool panel be stick on loading and metro bundler log error typeerror undefined be not a function link to code example the current behavior react devtool fail to load element prop style etc the expect behavior react devtool should load element prop style etc
facebookreact
bug disabled button state update prevent scrollintoview
Bug
I have a button that trigger scrollintoview for a node when click it also update some state which subsequently disable that button in certain case if the button become disabled the scrollintoview execution abort this seem to only happen in chrome brave react version 17 0 1 step to reproduce see step to reproduce in sandbox the current behavior describe above the expect behavior the state update should not prevent scrollintoview
facebookreact
bug devtool may crash when custom hook have the name usestate
Bug
react version 17 0 1 step to reproduce 1 clone repo 2 yarn start 3 open the browser of the start app 4 open devtool 5 click counter component in the component tab of the development tool 6 watch it not load anything and unhandled exception dump to the console log link to code example the current behavior devtool crash when I click on the following component in the development tool tsx import react from react function usestate react usestate 0 react useeffect function counter usestate react usestate 0 return open react dev tool component panel click on counter component and observe the crash in the log console export default counter the expect behavior no crash and the development tool show hook use
facebookreact
bug css variable can t be a space character
Bug
react version v16 v17 step to reproduce 1 2 notice the should be black border have a pink border 3 dangerously set inner html work because it doesn t go through react trim flow 4 I ve track the suspect code to here l44 link to code example the current behavior css variable have their value trim result in become which then remove the css variable from the browser image the expect behavior the value should not be trim image one potential option be to for any custom property that have a space value don t trim js if iscustomproperty value return value return value trim I m happy to do the bug fix I would also love for this to get release on v16 find a work around js style border color var
facebookreact
new jsx runtime advice for package author
Question
I m wonder if you have any advice around use the new jsx runtime in package with react as a peer dependency for compatibility reason it seem like package shouldn t use the jsx runtime at least not yet because then the package would only be compatible with version of react that include the new jsx runtime but in time this compatibility reason will fade if a package do use the new jsx runtime I think it could only be use in the esm and cjs build the umd build would still need to use createelement as the umd version of react doesn t include the jsx runtime curious if you could provide some insight on the plan for the jsx runtime in peer dependency package will the jsx runtime eventually be part of the react umd build do tooling need to support use the jsx runtime in esm and cjs build while always use createelement in the umd build thank I run into this issue when create rollpkg a zero config build tool to create package with rollup and typescript thank for all your work on react I ve really enjoy use it the past several year
facebookreact
bug react hook exhaustive dep false postive when give undefine as dep
Bug
there s currently a false positive for the react hook exhaustive dep rule as it do not accept undefined as dependency typescript below give react hook usememo have a miss dependency byid either include it or remove the dependency array const allid usememo object key byid undefine this be clearly noticeable together with typescript as it do not allow omit the second dep parameter with the follow typing typescript allow undefined but don t make it optional as that be very likely a mistake function usememo factory t dep dependencylist undefine t note here that dep must be either a dependencylist or undefined it be not list as optional react version 17 0 1 step to reproduce 1 install eslint plugin react hook 4 1 0 and extend it with plugin react hook recommend 2 write a hook that require a dependency list input undefine the current behavior give false positive when give undefined for dep the expect behavior should allow dep to be set to undefined
facebookreact
bug eslint plugin react hook construction should be catch in default prop args
Enhancement
react version 17 0 1 step to reproduce 1 js function usemyhook1 arr useeffect console log arr arr function usemyhook2 arr useeffect console log arr arr function mycomponent arr useeffect console log arr arr return null link to code example the current behavior no warning appear for arr be potentially construct on every render the expect behavior should warn that arr can be construct on each render the lint rule already warn for the following so this be just an extension of the exist behavior js const arr prop arr the arr logical expression could make the dependency of useeffect hook at line 54 change on every render move it inside the useeffect callback alternatively wrap the initialization of arr in its own usememo hook reference
facebookreact
bug eslint plugin react hook doesn t report conditional typescript hook
Bug
react plugin version eslint plugin react 7 19 0 typescript 4 0 must include operator step to reproduce tsx just a demonstration example obviously this be not ideal use of class class dog public usedogwoof useeffect console log woof const dogwoof dog dog dog dog usedogwoof should print conditional hook error return the current behavior typescript have the new 4 0 operator in case an object be undefined but this doesn t quite work along with hook as when the object be undefined the hook be not call thus the react renderer complain that the amount of hook be not the same or even worse untraceable type error that I have eslint plugin react hook be expect to be able to guard against that as well to prevent nasty error with this new typescript operator the expect behavior currently eslint plugin react hook doesn t take care of the typescript operator and think that nothing s wrong with use along one with a react hook
facebookreact
bug input minlength not work after type change
Bug
I have an input with type password with minlength 8 and I have a toggle to change the type to text password toggle when I type with length 8 and press submit it prevent to submit but when I toggle the password so it change the type to text and submit the form it can submit btw I use useref react version react 17 0 1 react dom 17 0 1 step to reproduce 1 type character minlength 2 submit form 3 toggle form type 4 submit form link to code example demo the current behavior the form get submit even when it under minlength the expect behavior the form not get submit when it under minlength
facebookreact
bug input type radio control value can get out of sync
Bug
react version 16 13 1 and 17 0 0 alpha 0 2d131d782 step to reproduce 1 render two input type radio name radio one be check one isn t 2 get warn about pass onchange or readonly 3 add empty onchange to both link to code example react 16 repro react 17 repro react 18 repro the current behavior screencapture of the describe behavior 1 react recommend readonly for input type radio even though this isn t support natively though react could polyfill it 2 after loop through the radio once with arrow key navigation the check state change the expect behavior arrow key navigation shouldn t break out of the control value it s debateable whether react should recommend readonly when this isn t a standard attribute like readonly for
facebookreact
bug handling of symbol when use as dep incorrectly to create error message result in an unrelated typeerror can not convert a symbol value to a string
Bug
react version 16 3 1 step to reproduce 1 click the button in this code sandbox the current behavior the wrong error be generate the expect behavior an error should still be generate but the error message should be correct the problem be that if you do symbol join javascript will freak out which be what happen if you put symbol incorrectly in the dep to hook
facebookreact
bug mouseenter do not fire when come from disabled element
Bug
react version 16 13 1 step to reproduce 1 move from a disabled element to an element with a mouseenter listener 2 mouseenter do not fire link to code example the current behavior mouseenter do not fire because react calculate mouseenter leave base on the relative element of the oppose event e g mouseenter calculate from the mouseout on the button browser do not fire pointer event on disabled element the expect behavior mouseenter should fire previous issue
facebookreact
bug form reset lose checkbox onchange event
Bug
hi I use checkbox uncontrolled mode onchange in form reset after lose onchange js but use add ref addeventlistener change onchange be ok js const checkref useref useeffect if checkboxref checkboxref current addeventlistener change onchange react version 16 13 and old step to reproduce 1 checkbox check 2 form reset 3 check check link to code example not react be ok reset be lose target onchange the current behavior 1 checkbox check target onchange 2 form reset 3 check check lose target onchange the expect behavior 1 checkbox check target onchange 2 form reset 3 check check target onchange
facebookreact
bug server hydration mistmatch and radio group with defaultchecke
Bug
when hydrate from the server whenever there s a mismatch in the initially check input in a radio button group and the input use defaultchecke uncontrolle there be no warning of that mismatch and the component behave in a buggy way for the input that be initially select in the server payload the onchange callback prop be not fire for the input that be mark as select in the initial html when select it worth note that use a control input use check make the bug go away react version 16 13 1 step to reproduce 1 in the example provide below make sure you refresh the browser within code sandbox 2 check the first radio button verify that the radio be check but the text next to it still show as not check which mean the onchange prop be not trigger 3 attempt to select any other option work fine and then back the first one work fine too 4 refreshing the page again choose any other option other than the first work fine link to code example the current behavior I know that use hydrate doesn t guarantee fix the mismatch but it say that it should warn about they in development hydrate in this case react doesn t warn about the mismatch and the behavior be buggy as show in the example and step to repro the expect behavior react should ideally work without the issue but give that it s not guarantee to be fix accord to the documentation it should at least warn about the mismatch
facebookreact
feature request allow dependency length to change in hook
Enhancement
not allow dependency list to change size limit the usefulness of usememo in this particular use case but I imagine there be other similar use case to be clear I be talk about the error trigger here l322 for instance in my app I have a bunch of item and the user can select an unlimited amount of they in another component I want to compute an expensive derive value base on this selection that be relevant only to this component a good use case for usememo however it be not currently possible to use usememo and I be force to compute this derive datum outside of this component even though I be only interested in do so whilst this component be mount I don t understand why a change in dependency list length can not be assume to be a change in the dependency itself I believe this can be implement by change the above to js if prevdep length nextdep length return false
facebookreact
arbitrary log line may appear in between an error and the subsequent the above error message
Bug
react version 16 12 if one component throw and one of its sibling log something else to the console that sible s log appear in between the throw component and the extra react information about that throw this be hard to explain in word but easy to explain in code and picture so look repro image the third log line the above refer to the first uncaught but look like it refer to the second please don t this be confusing when debug instead I would expect the above error to be right below the uncaught window level exception we raise maybe this isn t possible without diverge dev vs prod behavior not sure but think I d file
facebookreact
bug unexpected render
Bug
I m play with simple react component to understand when render occur the current behavior sample 1 1 initially render once regardless of the number of time the button be click it doesn t render this be expect import react usestate from react import style css export default function app const state setstate usestate i d 1 name test1 i d 2 name test2 const onclick setstate datum datum console log app render return test if set same datum cause re render call setstate with same data state map i d name name sample 2 2 initially render twice since useeffect update setmessage with a value this be expect however if the button be click 1 time it render once it shouldn t even re render since the same value be be set why be it render if no new value reference be be update import react usestate useeffect usememo usecallback from react import axio from axio import style css const day sunday monday tuesday wednesday thursday friday saturday export default function app const message setmessage usestate useeffect axio get then datum message setmessage message const display usememo message map content senderuuid sentat index let d new date sentat return content content senderuuid senderuuid dayoftheweek d getdate month d getmonth day day d getday year d getfullyear message const onclick usecallback setmessage message message console log app render console log message return usememo call setmessage with same datum display display onclick 1 2 the expect behavior should not re render if no new value or reference be update
facebookreact
bug eslint plugin react hook exhaustive dep false positive on unnecessary dependency if its a react component
Bug
step to reproduce 1 create a memoize value use usememo 2 a react component be use in the creation of this value in a jsx expression 3 specify the react component in the dependency array link to code example the current behavior react hook usememo have an unnecessary dependency component either exclude it or remove the dependency array react hook exhaustive dep the expect behavior no lint error more detail a simple repro take from the link above be javascript jsx function foo component component const memoize usememo render component return memoize render workaround if one change the component to lowercase the lint error go away it do also mean that we need to change the way we render the component javascript jsx function foo component const memoize usememo render component component return memoize render alternatively we can decide not to use jsx in which case the lint rule function correctly too javascript jsx function foo component component const memoize usememo render react createelement component component return memoize render impact currently it be hard to use prop that be component in a jsx expression if one be use the exhaustive dep rule this be also compound by the fact that this rule have a eslint fix that remove the dependency thus change the behaviour of the code and lead to bug see for that bug report
facebookreact
bug devtool dom highlighting get stick after a prolong hover
Bug
step to reproduce 1 hover a component in devtool 2 keep hover it for a second or so 3 quickly move the cursor out of the devtool without hover anything else expect dom highlighting go away actual dom highlighting get stuck
facebookreact
control numeric input get clear when unfocused
Bug
do you want to request a feature or report a bug I would like to report a bug what be the current behavior a numeric input field get clear accidentally on several occasion 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 this sandbox 2 type 12 into the field with the trail decimal separator 3 unfocus the control 4 append to the field s value to see 12 5 unfocus the control once again and see that the number have completely disappear what be the expect behavior similar to how uncontrolled input work remove the value prop and then repeat the step above the input should not be clear on blur 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 12 0 and experience the same behavior with the late version of chrome and io safari regard this bug I have no experience with previous version of react
facebookreact
should not already be work in firefox after a breakpoint alert
Bug
do you want to request a feature or report a bug bug what be the current behavior I m see error should not already be work after upgrade to react 16 11 which version of react and which browser os be affect by this issue do this work in previous version of react this be exclusively happen on an old version of chrome 68 0 3440 on window 7 I be unable to reproduce this in a vm environment but our sentry be get litter with these error I know it s a long shot but I wasn t able to find any information about this error anywhere just a reference in the error code file in react so think it would be a good idea to report this just in case curious if anyone have see this
facebookreact
react test renderer the findbytype method doesn t work with memo component
Bug
do you want to request a feature or report a bug feature what be the current behavior whenever I try something like reacttestrenderer create root findbytype somememocomponent I get the follow error no instance find with node type undefine the only way I find for this to work be to reference the type property of memo component like this reacttestrenderer create root findbytype somememocomponent type I be fine with this solution but then flow complain that type doesn t exist so I find myself fix this with flowfixme all over the place what be the expect behavior I would expect that pass a memo component to findbytype would work or that flow would recognize the type property of memo component I think both should work specially the first option which version of react and which browser os be affect by this issue do this work in previous version of react no it never work as far as I know
facebookreact
be it possible to share context between renderer
Enhancement
what be the current behavior hey I maintain react pdf thank for your awesome work and make react reconciler for we to use I ve get many issue lately regard context not work on my library and when do test I find out that context value aren t share between renderer this make it impossible to share state such as theme i18n redux and more as a bit of context react pdf be not a primary renderer and as such when use in the browser it run on top of react dom I find the isprimaryrenderer reconciler option that s suppose to be use for multiple renderer concurrently render use the same context object but still any access of the context inside react pdf component get s just the initial value even if the context be update with other value the same happen for react art that also set isprimaryrenderer false minimal demo I prepare a quick demo use react art so you can see how it currently work what be the expect behavior share context between renderer when use isprimaryrenderer config be there a way of achieve this be I miss something which version of react and which browser os be affect by this issue do this work in previous version of react react 16 11 0 react dom 16 11 0
facebookreact
eslint plugin react hook allow configure custom hook as static
Enhancement
do you want to request a feature or report a bug feature enhancement what be the current behavior currently the eslint plugin be unable to understand when the return value of a custom hook be static example jsx import react from react function usetoggle init false const state setstate react usestate init const togglestate react usecallback setstate v v return state togglestate function mycomponent someprop const enable toggleenable usetoggle const handler react usecallback toggleenable dosomethingwiththeprop someprop someprop exhaustive dep warn for toggleenabled return do something what be the expect behavior I would like to configure eslint plugin react hook to tell it that toggleenable be static and doesn t need to be include in a dependency array this isn t a huge deal but more of an ergonomic papercut that discourage writing use custom hook as for how where to configure it I would be happy to add something like this to my eslintrc js statichook usetoggle false true first return value be not stable second be useform true entire return value be stable then the plugin could have an additional check after these 2 check l228 l231 that test for custom name which version of react and which browser os be affect by this issue do this work in previous version of react all version of eslint plugin react hook have the same deficiency please read my first comment below and try my fork if you be interested in this feature
facebookreact
typeerror requestanimationframe call on an object that do not implement interface window
Bug
do you want to request a feature or report a bug bug what be the current behavior typeerror requestanimationframe call on an object that do not implement interface window 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 l88 in the webextension content script globalthis window so when const requestanimationframe window requestanimationframe the this binding of raf be lose in the after call raf rebind to the globalthis but globalthis doesn t implement window interface poc install this extension in the firefox and you will see the error report index js try const raf window requestanimationframe raf console log okay catch e console warn e manifest json name raf in content script test version 0 0 1 manifest version 2 content script js index js match 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 firefox in webextension relate to
facebookreact
devtool v4 do not work with firefox s private window
Bug
do you want to request a feature or report a bug bug this issue have be report in what be the current behavior step to reproduce be here 1 environment be 2 open the page which use react with a private window 3 open firefox s devtool actual result be react devtool component pane show unable to find react on the page from about debug we can see the below messsage securityerror permission deny to access property container on cross origin object main js 51 305877 kl moz extension 56db142d 3d36 b04e 91ca a7504c7708a5 build main js 51 apply self host 4417 applysafewithoutclone resource gre module extensioncommon jsm 588 asyncwithoutclone resource gre module extensioncommon jsm 2400 what be the expect behavior react devtool work which version of react and which browser os be affect by this issue do this work in previous version of react firefox 68 react devtool v4 0 5 react v16 9
facebookreact
devtool component tree be sometimes unexpectedly empty after navigation
Bug
1 open fb page 2 open component tab 3 change address bar to and press enter expect component tab get populate actual if I inspect background page I see this fix by 229 originally report by gaearon via
facebookreact
devtool re enable postmessage transferable for fast arraybuffer transfer
Bug
I get this on fb com sandbox originally report by gaearon via
facebookreact
devtool crash and warning when quickly collapse
Bug
this be weird happen if I select a node deeply and then long press leave arrow invalid index 154 specify store contain 154 item uncaught invariant violation expect to find a host parent this error be likely cause by a bug in react please file an issue at reacterror file user gaearon p react devtool experimental shell dev build devtool js 8529 40 it start with invalid index and then give I different react invariant or warning depend on how lucky I be screen recording 2019 04 25 at 05 58 pm more weird symptom this fix it diff runwithpriority userblockingpriority dispatch action next dispatch type update inspect element i d runwithpriority userblockingpriority dispatch type update inspect element i d so I suspect it s a bug with scheduler next this also look funky note how somewhere in the middle right pane get stick show the same cycle of value screen recording 2019 04 25 at 07 36 pm react bug originally report by gaearon via
facebookreact
devtool well link between browser performance tab and devtool profiler
Enhancement
note from a chat with benoit it would be nice if start profiling or reload and profiling in the browser auto start profiling in devtool it would also be nice if view a range of time in the performance tab narrow down the commit within the profiler at least start the profiler at the same time would enable a manual match up to my knowledge none of the currently available apis include experimental would enable we to support this level of integration if we be to make use of the devtool protocol we could profiler start and profiler stop the build in profiler in sync with react s own profiler chrome s profiler also dispatch profiler consoleprofilestarte and profiler consoleprofilefinishe event which we could use to follow the browser s profiler if we want to there do not appear to be any apis event for sync the zoomed in range originally report via
facebookreact
devtool should profiler surface the base duration
Enhancement
benoit share feedback that it would be helpful to show the base duration for the tree and or select element to get a sense of the total cost over time not sure yet what we d call this originally report via
facebookreact
devtool collect more info when profile
Enhancement
some feedback I ve hear from a devtool user roughly transcribe by I I m try to pinpoint those render with hook it s sometimes more unclear to I why something be render I generally don t use devtool much anywhere I use console log but redux devtool work really well for I because I could see when thing be change and what exactly change maybe we could add an opt in mode in setting profiler to collect more datum when profile about why a component render for example if prop or state change we could show which key change just their name not their value maybe we could do something similar for context and for hook then we could add this information to the right side panel for the select fiber in the profiler ui originally report via
facebookreact
devtool component bookmark
Enhancement
product developer sometimes find it useful to jump back and forth between a few component in a tree currently this require scroll or use the selection tool maybe we could allow you to temporarily bookmark one or more component somehow then the exist search interface could maybe be repurpose to let you step between bookmarke component when there s no search text these bookmark would probably not need to be persist between reload so they could be associate with the specific in memory element1 1 although this association would be lose with a filter change originally report via
facebookreact
devtool profiler show which hook change
Enhancement
can you show which hook change be a question I ve hear a couple of time with regard to the new profiler change tracking feature this request be certainly understandable but it present a couple of challenge 1 identifying which hook value change would require shallowly re render each function component 2 identify a hook in a non ambiguous way require display the full hook tree structure since hooks aren t name alternately we could support name hook 16474 let s take each of a look at each of these below 1 identifying which hook value change one of the challenge for devtool when it come to hook be identify custom hook sebastian s propose solution be that devtool temporarily override react s hook dispatcher while it shallowly re render the component during the re render each time one of the build in hook be use our override implementation parse the stack to identify custom hook function high up in the callstack that begin with use after render be complete we reassemble this information into a tree structure which devtool can display currently we only do this shallow render when a component be inspect inspect an element but in order for we to track which hook have change while profile we would need to shallowly render every component use hook during the profiling session mostly likely we would have to do this during the performance sensitive commit phase since that s when devtool be notify of an update I think we could do well than re run the above hook override for every component on every commit if we create a map of fiber to cache hook tree structure lazily populate the above map by shallow re render only when a component be update for the first time compare fiber memoizedstate s to identify change on future commit and map they back to the tree structure base on their position in the list structure 1 however even with the above optimization this would still add significant overhead to a performance sensitive phase 1 I think this should work but might also end up be complicated to implement 2 identify a hook although the variable that hook value be assign to are meaningfully name the hook themselves be unnamed because of this devtool have no feasible way of identify a hook short of display the entire hook tree structure consider the following example code js function usecustomhook const foo setfoo usestate function examplecomponent prop const bar setbar usestate const baz setbaz usestate const custom usecustomhook the example above show 4 hook three usestate and one custom let s say that foo and baz change in a particular render how would devtool identify this it could just show two state hook but that s not very helpful I think the only way we could identify it would be to show the entire tree and visually highlight which hook in it have change state state customhook state this be okay but it s not great unless the developer be cross reference the component and probably the custom hook definition as well to help with this we could also show the value but now we re add more overhead in term of trackin and bridge traffic in summary clearly both of these challenge can be overcome but they be non trivial to implement and they will certainly add more runtime overhead to the profiler because of this it may be a while before we add this feature to the devtool originally report via