repository
stringclasses
156 values
issue title
stringlengths
1
1.01k
labels
stringclasses
8 values
body
stringlengths
1
270k
facebookreact
context consumer unexpectedly update each time one of its child component call setstate
Bug
do you want to request a feature or report a bug report a bug what be the current behavior each time a child component of context consumer call setstate its parent context consumer re render if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below what be the expect behavior presumably the expect behavior be one where set the state of a child component do not affect any parent context consumer component particularly when that state do not change which version of react and which browser os be affect by this issue do this work in previous version of react version 16 3 0 alpha 1 16 3 0 alpha 0 browser chrome osx 10 13 3 64 0 3282 140 this work as expect when the previous context api be use
facebookreact
regression react 16 automatically mark first item of a mutliple select as check
Bug
do you want to request a feature or report a bug bug regression what be the current behavior in react 16 when create a the first child be automatically get mark as select in react 16 there do not seem to be a way to specify no get select by default what be the expect behavior in react 15 unless you mark an option to be select no option be select by default which version of react and which browser os be affect by this issue do this work in previous version of react version effect include react 16 2 this work in react 0 13 and react 15 this bug be reproducible in chrome 64 and firefox 58 the hacky workaround I find to get around the first option get select be to inject a as the first child of the multiselect
facebookreact
unexpected contextconsumer or contextprovider behavior
Bug
do you want to request a feature or report a bug bug what be the current behavior when use two or more context that create by createcontext in the child tree of cxt2 provider I use cxt1 provider to set a new context of cxt1 I expect only the child consumer get the new cxt1 but the result be that the cxt2 provider s next sible s child tree get an unexpected cxt2 provider s new context 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 createcontext issue what be the expect behavior contextprovider only affect the child node which version of react and which browser os be affect by this issue do this work in previous version of react react 16 3 0 alpha 0
facebookreact
onchange behaviour on radio button in 15 6 2
Duplicate
do you want to request a feature or report a bug a bug what be the current behavior when assign the onchange listener on a radio button group or its form the event only fire once per radio button if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below I create a basic example of the problem which be work in jsfiddle since I guess its use the most up to date version of react I also find a workaround for the problem by use a component internal state detail here what be the expect behavior the onchange event should fire every time the select radio button change which version of react and which browser os be affect by this issue do this work in previous version of react affect version be 15 6 2 and as far as I can tell it happen across all browser I do not check previous but future version and in 16 x this problem appear to be fix sadly we be still in in the process of prepare for the update to 16 x
facebookreact
get start doc be terrible
Question
I just come back to react after about a year or so of not use it and now the getting start doc be pretty much not helpful in the slight all the doc be now be just link to other website without any instruction on how to get a react project run I remember a year ago back in react 15 the doc have a step by step walkthrough for how to set up and get a project run from scratch and now they be just link to website without react specific instruction what happen to the doc when do they become so useless there need to be a step by step guide add back to the doc a guide that will get you from have nothing to run it in the browser instead of just link to other website that don t have anything to do with react I remember back in react 15 you could run through the guide and have a hello world app run within 10 minute no problem I have be try to figure it out with these new doc for over an hour now and still 0 luck get this run the instruction use to actually be instruction basically say install this then that then run this command in terminal then do this and so on the doc now just say well you can use this then have a link to a site that have nothing to do with react there be not even any sort of instruction on the react website on what to do with that just the link without any context around it can these doc please be revert to the old version or actually create a proper getting start page to get you from nothing to run
facebookreact
react test renderer asynchronous rendering guarantee
Question
do you want to request a feature or report a bug I think this be just a question as I understand it react s new fiber architecture introduce an asynchronous rendering pipeline which allow for well prioritisation of work I m also aware that in version 16 react be still expect to render synchronously look forward though when use react test renderer especially the reacttestinstance l466 l512 helper apis what guarantee be safe for a developer to lean on after create a test renderer instance be it safe to immediately introspect the instance to look for a child node with a give type do this differ from component with user space asynchrony for instance if I have a class component with a child node that I want to make a test assertion against be this safe if not be there a safe way to flush pende reconciler change or check for pende work const renderer reacttestrenderer create const childinstance renderer root findbytype childnode instance currently I be experience intermittent 1 in 50 or so failure in test assertion that look like this the error output look like fail path to mycomponent test jsx 8 116s mycomponent test assertion against child node instance no instance find with node type childnode at expectone node modules react test renderer cjs react test renderer development js 8161 9 at reacttestinstance findbytype node modules react test renderer cjs react test renderer development js 8009 12 which version of react and which browser os be affect by this issue do this work in previous version of react I be see this failure when run with in while run in
facebookreact
contextconsumer and contextprovider in react test renderer
Bug
do you want to request a feature or report a bug bug what be the current behavior unsupported component type 13 in test renderer this be probably a bug in react invariant be call because react test renderer do not know about the the contextconsumer and contextprovider component type if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below what be the expect behavior it can identify the new context type which version of react and which browser os be affect by this issue do this work in previous version of react 16 3 0 alpha 0
facebookreact
concate react with other resource
Question
hi I want to use many library and framework in my project can i concat react with other framework like angular vue ember
facebookreact
document the use of setstate in componentwillunmount
Question
do you want to request a feature or report a bug feature what be the current behavior excerpt from documentation componentwillunmount be invoke immediately before a component be unmounted and destroy perform any necessary cleanup in this method such as invalidate timer cancel network request or clean up any subscription that be create in componentdidmount the docs don t mention if setstate can be use in componentwillunmount consider the following example where the state showgreeting be undo by timer over time but since the timer have to be invalidate in componentwillunmount there no other place to reset the state class helloworld extend component state showgreete false onclick this setstate showgreete true this timer settimeout this setstate showgreete false 3000 componentwillunmount cleartimeout this timer be it legal this setstate showgreete false be it legal to call setstate from componentwillunmount give that it can be asynchronous it feel that setstate may not be invoke until after component be actually unmounted which may produce a warning in my understanding until componentwillunmount actually pump up the state s dispatch queue manually to ensure that all state change land in component before it s too late if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below what be the expect behavior not sure which version of react and which browser os be affect by this issue do this work in previous version of react 16 2 webkit
facebookreact
input not account for by form
Invalid
do you want to request a feature or report a bug a bug what be the current behavior input render by react control or uncontrolle be not account for when submit form for instance html will produce the following form datum foo1 bar1 foo2 bar2 whereas html with this component jsx function myinput prop return will produce foo1 bar1 I can t get a fully work example on codesandbox as this require look at the result http request or have jquery or such to serialize the form what be the expect behavior the second example should produce foo1 bar1 foo2 bar2 react component should be usable in regular form note browser inspector show expect value s and name s for the react render input however it seem the value attribute use getter and setter for these input whereas plain html input value s be just string which version of react and which browser os be affect by this issue do this work in previous version of react react 16 2 0 test on chromium 64 0 and firefox 58 0 on archlinux
facebookreact
react test renderer totree do not yet know how to handle node with tag 10
Bug
do you want to request a feature or report a bug bug what be the current behavior js renderer create foo totree invariant violation totree do not yet know how to handle node with tag 10 what be the expect behavior return a tree which version of react and which browser os be affect by this issue do this work in previous version of react 16 2 0
facebookreact
can t edit the wiki
Question
hello I can t edit the wiki to add my website to the list there be edit disabled
facebookreact
access component from child s instance
Question
I be create a small generic state management base on the proxy object now I be write a react helper but I ve find an issue to create the hoc I need access to component from react look at the source code for component it doesn t seem like it can should be a standalone function this library should be able to be use independently so make everyone download react be not feasible I have navigate through the official hoc documentation past issue and google but couldn t find any way to retrieve component from the pass component to my hoc this be the code I be work with not yet in the repo link above js this will load the whole react independently of the project type import component from react const connect opt pass return class withstate extend component export default connect js note assume this for pass js import react component from react class pass extend component export default connect pass now I do find a hack to make this work but it seem like one of the most fragile piece of code I ve ever write rely on the difference between es7 module and commonj js const connect opt pass const react require react return class withstate extend react component export default connect this way it will only import react once the connect be use and connect be the react exclusive helper from my library so my question feature request be this be it possible to access its constructor s parent not just the child could we make it possible somehow something like this would be ideal js be something like this possible const component pass super or const component pass constructor super or even since a class be syntax sugar const component pass prototype super I think that be not the way javascript react work but I figure I will ask here since chance be you will know way well than I whether something like this be possible or not do you want to request a feature or report a bug request a feature I think
facebookreact
typeerror can not read property state of undefined with create react class
Question
I be currently attempt to create a button which be red with the text yes that when you click on it the button change to a green color with the text confirm before the final stage in which an action take place where I be currently at be define buttoncolor as a state which change on the click of the button the initial color should be fd8f83 and the final color after the click should be a4d87c however I be currently get the error typeerror can not read property state of undefined pointing to the style backgroundcolor this state buttoncolor line whenever the code be compile on the webpage define initial state and behavior on click getinitialstate function return buttoncolor fd8f83 handleclick color this setstate buttoncolor color code inside table in render yes do anyone have any idea why this be I be brand new to react so I apologize if it s obvious I also learn react use createclass so I ve be try to piece together how to make this work with the new create react class package any advice be greatly appreciate react 16 2 0 chrome version 63 0 3239 132 official build 64 bit
facebookreact
all control field re render on any setstate call even though their datum have not change
Bug
do you want to request a feature or report a bug report a bug what be the current behavior basically I have many control field in the app that I be currently develop and I normally only want they to re render when their value have change through their onchange event but they re render every time setstate get call anywhere within the component or any parent component I even try create a custom component which only contain a and set shouldcomponentupdate to return false but it seem to ignore that command completely it s weird because in this case the console log s in my child component s render function don t get execute but the field get re render nonetheless this issue be cause some major performance problem in my app I hope someone address this issue as fast as possible so I can continue work on my react project maybe someone can provide a temporary workaround please let I know if there s something I m miss or if I m use this field incorrectly if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem your bug will get fix much fast if we can run your code and it doesn t have dependency other than react paste the link to your jsfiddle or codesandbox example below I have isolate the problem in a new empty app and you can see the behavior in the follow gif the code be very simple you can recreate this problem by create 2 control field one and another then go to your browser inspect the element and input something in the basic input field the will re render on every new typed letter in the field but not the other way around javascript import react component from react import logo from logo svg import app css class app extend component constructor prop super prop this state ta1 ta1 ta2 ta2 ta3 ta3 i1 i1 i2 i2 i3 i3 this handleinputchange this handleinputchange bind this handleinputchange event this setstate event target name event target value render return welcome to react test textarea input field export default app what be the expect behavior the field should only re render when its data be change which version of react and which browser os be affect by this issue do this work in previous version of react I be able to recreate this problem on react version 16 2 0 late and 15 6 1 I do not test on other version so I be not sure if this work correctly before I m use chrome 62 0 3202 94 64 bit late and firefox 57 0 4 64 bit late on ubuntu 14 04
facebookreact
problem when input type change from email to text
Bug
do you want to request a feature or report a bug bug what be the current behavior when an input field change from email to text an exception typeerror will be throw from setselection screenshot reproduction see here what be the expect behavior it should not crash because of an uncaught exception which version of react and which browser os be affect by this issue do this work in previous version of react master firefox this would be my propose change to fix the issue
facebookreact
event handler on fragment
Enhancement
the use case be when an abstraction want to listen to some event bubble up and intercept the event somehow js function abstraction prop return prop onaction prop child perhaps there be some state and context involve too this work fine today as long as you can wrap it in a however you can t necessarily always do that I hear that some of this will be relaxed but conceptually I think the constraint will remain in many environment that you don t want a wrapper element around these js a b js a b a b it would be nice to be able to use fragment for this js function abstraction prop return prop onaction prop child it be easy to implement with the synthetic event system but I suspect it be doable with other approach too include just insert an element call in the dom to implement this we d need somewhere to store the current prop we can use the statenode on fragment fiber to hold that we also need to schedule commit phase effect whenever the set of event handler on a fragment change in the commit phase we update the statenode on both fiber to hold the current prop that way when we bubble up the fiber return pointer we know that statenode hold the current set of prop and those will be the one we extract event handler from
facebookreact
some event be miss on master for simulatenative
Bug
see my comment in discussion r161108162 it s not really document but people might rely on this need to fix
facebookreact
get minification warning even with defineplugin and uglifyjsplugin
Question
hello I ve scour through other issue and can t figure out why the warning be still around because it feel like I ve do everything here s the setup build script heroku postbuild npm run build prod build webpack webpack progress display error detail bail build dev npm run build webpack config config webpack development config js build prod node env production npm run build webpack config config webpack production config js base config js config plugin new webpack optimize occurenceorderplugin new webpack defineplugin set up some other constant on process env production config js var config extend baseconfig config plugin push new webpack defineplugin process env node env json stringify production new webpack optimize uglifyjsplugin mangle true compress warning false output comment false exclude min js gi new webpack optimize dedupeplugin some more plugin use react v15 4 2 and webpack v1 14 0 I m not sure what I m miss defineplugin and uglifyjsplugin seem to be declare properly and the node env be set to production up in the script any help would be greatly appreciate thank you
facebookreact
warn in server renderer if class doesn t extend react component but have a render method
Enhancement
same as but for the server renderer you can look at implementation in and do something very similar in reactpartialrenderer js
facebookreact
state initialization disparity between shallow renderer and reactdom
Bug
do you want to request a feature or report a bug bug what be the current behavior the shallow renderer default a class component s state to empty object if it s not set real renderer don t seem to do this so a component can render successfully in the shallow renderer but fail at runtime in the browser with a null reference error if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem here be reactdom s behavior crash read an uninitialized state value here be the shallow renderer behavior component able to render what be the expect behavior they initialize state in the same way which version of react and which browser os be affect by this issue do this work in previous version of react react 16 this wasn t an issue in react 15
facebookreact
react call return expect to find a host parent
Bug
do you want to request a feature or report a bug bug what be the current behavior a specific order of unmounte and remount unstable createreturn s from react call return cause an invariant violation in unmounthostcomponent reproduce the follow sandbox example crash with an invariant violation when both the min and cycle prop be odd number great than zero what be the expect behavior the app do not crash and cycle the number of item in the list which version of react and which browser os be affect by this issue do this work in previous version of react react and react dom version 16 1 and new react call return version 0 5 0
facebookreact
how to auto refresh in another tap in react js
Invalid
I m open the login page in two tab in the same browser the login click after another tab also refresh or reload how to do that in react js do anyone help this
facebookreact
click event don t bubble from portal content on mobile safari
Bug
do you want to request a feature or report a bug bug what be the current behavior in mobile safari dom event originate from element render through a portal do not bubble propagate up the react component tree if the current behavior be a bug please provide the step to reproduce please see the follow jsfiddle in this jsfiddle the expect behavior see in a desktop browser be that click on the portal content appear as a modal include backdrop should toggle to the on or off indicator render in the main content however in mobile safari io 11 1 1 the click event do not propagate what be the expect behavior click event should propagate up the react component tree which version of react and which browser os be affect by this issue do this work in previous version of react affect react 16 2 io 11 1 1
facebookreact
react art crash with ssr
Bug
do you want to request a feature or report a bug bug what be the current behavior react art crash when component be render with node what be the expect behavior no crash the issue lie upstream in the art fork and there be a propose fix but the pr need attention so I m cross post here hope that s ok
facebookreact
react dom crash when contain three interpolate value if one be a conditional
Bug
do you want to request a feature or report a bug bug what be the current behavior react dom crash when contain three interpolate value if one be a conditional reproduction 1 change the value of the 2 react crash with notfounderror node be not find from what I can tell the conditional value be necessary and it must be three interpolate value what be the expect behavior react should not crash which version of react and which browser os be affect by this issue do this work in previous version of react react dom 16 2 and 16 0 I think this work in 15 6 do not crash
facebookreact
shallowrenderer not consider contexttype when render child
Bug
do you want to request a feature or report a bug bug what be the current behavior shallowrenderer not consider contexttype note I be not able to easily include react test renderer in a fiddle so I include a unit test context use in shallow and normal rendering const context appname abc mode def class toplevelcomponent extend react component render return this prop child getchildcontext return context toplevelcomponent childcontexttype appname proptype string mode proptype string class component1 extend react component render return component1 contexttype appname proptype string use shallow renderer and assert that we get appname but not mode const shallowcomponent1 new shallowrenderer render context expect shallowcomponent1 prop appname tobe abc pass expect shallowcomponent1 prop mode tobeundefine this expectation fail render component1 under a component with childcontext const wrappedel react createelement const domnode document createelement div reactdom render wrappedel domnode const html domnode innerhtml expect html tocontain abc pass expect html not tocontain def pass as you can see this property be undefined what be the expect behavior I would expect that when render component1 with shallowrenderer render method would check component1 contexttype and mask any property that be not specify there just like function getmaskedcontext workinprogress unmaskedcontext do in react dom library I fix this behavior by change render method like this inpire again by getmaskedcontext const oldrender shallowrenderer prototype render shallowrenderer prototype render function render element const unmaskedcontext argument length 1 argument 1 undefined argument 1 if element element type unmaskedcontext if element type hasownproperty contexttype const context for const key in element type contexttype context key unmaskedcontext key argument 1 context return oldrender apply this argument which version of react and which browser os be affect by this issue do this work in previous version of react this bug be for version 16 we be upgrade from react 15 we be use enzyme shallow rendering and this wasn t the behavior it be difficult to say which part of the code have change between react 15 and enzyme at this point but my code sample include only code from react library
facebookreact
cursor jump when backspace in a number input with shadowdom
Bug
do you want to request a feature or report a bug bug what be the current behavior number input with decimal value in chrome shadowdom do not maintain cursor position as user backspace in the input field super low quality gif sorry this issue appear to be similar to the problem here but in this case it s only custom element with a shadow root that exhibit the problem if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 1 have a react component render a number input 2 attach that react component as part of the shadowdom node of a custom element 3 enter in some decimal value e g 88 88 into the input 4 slowly backspace in the input as soon as the decimal point would be the last character the decimal point be remove and the cursor position jump to the beginning of the input demo what be the expect behavior the shadowdom case behave like the other case when backspace in the input the cursor do not jump to the beginning of the input and the decimal point be not unexpectedly delete which version of react and which browser os be affect by this issue do this work in previous version of react react 16 2 0 chrome 62 0 3202 62 osx 10 12 6
facebookreact
react test renderer do not include key on fragment
Bug
do you want to request a feature or report a bug bug what be the current behavior from the docs key fragment jsx function glossary prop return prop item map item without the key react will fire a key warning item term item description if I do this jsx renderer create tojson the result be json type dl prop child type dt prop child term type dd prop child description if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 see above what be the expect behavior that somehow the key be not lose I m not sure where it would make sense but it should be in there somewhere which version of react and which browser os be affect by this issue do this work in previous version of react 16 2 0
facebookreact
false positive warning about style mismatch when hydrate server markup in ie11
Bug
do you want to request a feature or report a bug bug not a biggy not sure if ie11 be support for development what be the current behavior ie11 seem to always throw a warning for hydration failure eg warn prop style do not match server text decoration none client text decoration none note there be a space between the colon and none from server client have no space if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 have a ssr render component use inline style go to page1 then hydrate it on ie11 reactdom hydrate component document getelementbyid app this do not occur in either chrome or firefox what be the expect behavior no warning which version of react and which browser os be affect by this issue do this work in previous version of react react 16 1 1 browser ie11
facebookreact
select warning fire repeatedly
Bug
do you want to request a feature or report a bug bug what be the current behavior see fiddle the warning relate to the select fire repeatedly gaearon tell I it should dedupe and that this be a bug if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 see above what be the expect behavior see above which version of react and which browser os be affect by this issue do this work in previous version of react 16 2
facebookreact
hydrate a component with dangerouslysetinnerhtml and tostre cause a warning and the component to not render
Bug
do you want to request a feature or report a bug bug what be the current behavior when hydrate a pre render component that use dangerouslysetinnerhtml an object with a tostring method we get a warning such as warning do not expect server html to contain the text node bonjour in the component will also appear blank this be noteworthy since the markup return by render appear to be correct mean the markup that an ssr server return be correct the markup that appear on page if we just use render on the client without ssr be correct it s only if we do both that we get error if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 code for posterity js import react from react import hydrate from react dom const helloobj tostre bonjour const mycomponent hydrate document getelementbyid app what be the expect behavior the component be not blank and no error be output in the console which version of react and which browser os be affect by this issue do this work in previous version of react react react dom 16 2 0 this work 16 confirm work in 15 6 1 if we use the render method chrome version 62 0 3202 94 os x 10 12 6
facebookreact
figure out a well fix for memory leak
Enhancement
see file this as a follow up
facebookreact
fix the misleading error message in production
Bug
see this test case l142 l157 pretty sure the different message in production wasn t intentional but be a consequence of reactcurrentowner current not be set in production for functional component we need to see if it s possible to emit the same useful message both in development in production if it s not possible we need to change the production message to be more ambiguous instead of suggest the wrong reason for the problem
facebookreact
react createelement type be invalid warning in ie11 when use react fragment
Bug
react show warn in console if I use react fragment warning react createelement type be invalid expect a string for build in component or a class function for composite component but get object
facebookreact
do we still need to stringify attribute before assign they
Enhancement
react manually stringifie all attribute before assign they l169 l179 this appear to be for ie8 9 however it s possible that this be an ie8 only behavior see ie9 can we get rid of value in dompropertyoperation
facebookreact
client server mismatch for text inside of an a button cause the the a button to focus on page load
Bug
do you want to request a feature or report a bug bug what be the current behavior if there be a client server mismatch for text inside of an a or button element it cause it to be automatically focus on page load if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 let text let url randomurl if typeof window undefine text client text else text text return text if the focus be not on the window I e if a dom element be select in the chrome inspector or react inspector widnow then it doesn t add the focus what be the expect behavior the expect behavior be that it would either show client text or text depend on how react16 resolve the diff but for it not to be automatically highlight which version of react and which browser os be affect by this issue do this work in previous version of react react16 macosx chrome ff safari
facebookreact
reactdomserver rendertostaticmarkup get stick while try to render portal
Bug
call reactdomserver rendertostaticmarkup elementwithportal get stick in a loop while try to do a static render current behavior the behavior can be see here by un commenting line 58 warn this will make your tab freeze expect behavior it should return with result or throw some kind of error if the input be not valid
facebookreact
react dom ability to access window event in development
Bug
import from issuecomment 345331144 at request of gaearon do you want to request a feature or report a bug bug what be the current behavior in development mode react use invokeguardedcallback to be able to catch error without interrupt the normal break on uncaught exception feature of devtool in the current implementation of invokeguardedcallback an event be create and dispatch which allow for error handling without a try catch block unfortunately it have the side effect of overriding window event and so you be unable to access window event within guard callback when run react in development mode in production mode it work fine we would like to access window event at superhuman to be able to detect where dom focus be from the user s point of view usually this be document activeelement but in a few case like during a blur event or when click between two iframe the focus will end up in a different place this work fine in production and we currently work around this in development mode by override reactdom secret internal do not use or you will be fire reactdomeventlistener handletoplevel and maintiaine a reference to the event in production mode we just use window event if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 in development in production in both case I would expect the alert to say window event type click but in development it say window event type react invokeguardedcallback what be the expect behavior I would like a way to access window event in development I m happy for this to be somewhat obscure but ideally I would not have to use the secret internal to make this work which version of react and which browser os be affect by this issue do this work in previous version of react development 0 15 and 0 16 at least probably before
facebookreact
sluggish scrolling when render table with large dataset in react
Question
so I m create an application with real time stream datum in a table use react v16 1 1 the number of row show at a time can be rather large 400 row and when those situation occur the scroll behavior on browser desktop mobile really take a hit and stagger when attempt to browse the content have anybody experience this kind of scroll behavior when render large data set in a table I m expect react to be able to efficiently draw redraw these element with ease but that doesn t appear to be the case I try use jsfiddle to recreate the scenario but do not have much success
facebookreact
disabled button click event propagate in ie11
Bug
do you want to request a feature or report a bug bug what be the current behavior click a disabled button in ie11 fire a mouse event that bubble and be catch by parent click event listener the event be swallow not fire in all other major browser if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 what be the expect behavior the event should not fire or bubble which version of react and which browser os be affect by this issue do this work in previous version of react react 15 6 2 ie11
facebookreact
question from react reconciliation
Question
with the goal to well understand react reconciliation I create this example just a simple timer component basically which show each second pass class stateful extend react component constructor prop super prop this state timer 0 componentdidmount let that this setinterval function that setstate function prevstate return timer prevstate timer 1 1000 render return this state timer just a demo class for understand reconciliation class demo extend react component constructor prop super prop this state componentdidmount let that this settimeout function that setstate showwarning true 3000 render if this state showwarning return I be hope this would create a new instance of stateful component after 3 second return reactdom render document getelementbyid container you can see after three second showwarning be set to true so I be believe that after three second I would get a new instance of component because it live in a different div than the one render already hence I would see the output of stateful component start from 0 again but the timer just continue to increase on the screen so the output basically be 0 1 2 3 4 and so on each second whereas I expect it to show 0 1 2 and on third second do a restart basically and start 0 1 2 3 etc what do I miss from reconciliation doc that lead I believe in this I have a feeling the react doc on this miss to highlight this or it might be I miss something
facebookreact
forceupdate recall all ref callback
Question
do you want to request a feature or report a bug bug maybe what be the current behavior on call forceupdate ref callback call again so do forceupdate in ref callback make infinite loop if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 what be the expect behavior do not recall ref which version of react and which browser os be affect by this issue do this work in previous version of react react 16 1 1 chrome 62
facebookreact
question what be your workflow to release a new version
Question
hello if I be totally out of place ask this here I be sorry please close this issue I work at a german newspaper and we be publish some small npm package publically as open source and some for our own purpose privately currently we be not quite sure of our workflow and we want to learn from the good you we be wonder how you manage to publish new release of react I see you have some release sh script we have an npm script that basically build our package bump the version and publish the lib to npm so far this seem quite similar correct I if I be wrong also when we want to publish a new release someone just run that npm script from their laptop this seem somewhat unsettling it feel like there should be more this so I be wonder if you care to answer how do you do it at facebook
facebookreact
include component stack in invariant
Enhancement
iirc we didn t include it because it be dev only but it s not anymore maybe let s start include it error be often more prominent than warning and it would be great to have this info in both
facebookreact
undo operation on text input throw exception in ie9
Bug
do you want to request a feature or report a bug this be a bug report it look like ie9 be unmounte text node when undo text input operation if the display value of the input be render in another component it raise an exception because ie9 do not allow change to nodevalue on unmounted text node I think that s the issue anyway it be document here what be the current behavior 1 open in ie9 2 change the text in the first control text input 3 start debug in the ie9 developer tool 4 press ctrl z to undo your text change 5 ie9 raise an exception when set the nodevalue of the text label to the right of the input invalid argument what be the expect behavior which version of react and which browser os be affect by this issue do this work in previous version of react this affect ie9 when use react 16 it be also an issue on master the issue spring up in reactdom js l392 l398 I think there just need to be a wrapper around the text node to see if it have a parent before update maybe something like javascript committextupdate textinstance textinstance oldtext string newtext string void ie9 will raise an exception if modify a detach text node if textinstance parentnode textinstance nodevalue newtext but that feel like a band aid solution I m curious what be cause the text node to unmount to begin with
facebookreact
child of option tag flatten when select have value
Bug
do you want to request a feature or report a bug bug what be the current behavior when the follow be render to string use reactdom jsx a b I get html a b when hydrate the above code I get this warning warn text content do not match server a b client a fiddle what be the expect behavior I should get html a b which version of react and which browser os be affect by this issue do this work in previous version of react 16 1 1 this have something to do with flattenoptionchildren in reactpartialrenderer js ps when browse reactpartialrenderer js I find this code js prop object assign select undefined child undefined prop select select child optionchildren what be the point of those undefined prop when they be overwrite later on
facebookreact
can t access discuss react
Question
I know this be not relate to react directly but didn t know where to turn to am I the only one who can t access login to discuss reactjs org for quite some time already I get error this page isn t work discuss reactjs org be currently unable to handle this request http error 500 and sometimes when I retry this error sorry there be an error authorize your account perhaps you do not approve authorization
facebookreact
investigate need to feature check cancel and close event
Enhancement
the reactbrowsereventemitter check for browser support of the cancel and close event l136 l138 before attach those listener I m curious why this be necessary do we need it for ie8 I d like to determine if there be ramification to remove these check add comment above those line if these check be necessary x maybe eliminate iseventsupporte js this be need to check for input in changeeventplugin
facebookreact
add warn when hydrate output from rendertostaticmarkup
Enhancement
do you want to request a feature or report a bug feature what be the current behavior I accidently generate my ssr output use rendertostaticmarkup instead of rendertostre which I then hydrate use hydrate this lead to a warning cause by collapse text node rendertostre would have add html comment between they the warning I get be warn text content do not match server a b client a when render jsx const a a const b b const component a b it would be nice if hydrate could detect that it be execute on output from rendertostaticmarkup instead of rendertostre it seem to I a simple check on the datum reactroot attribute on the root element would suffice what be the expect behavior I would like some kind of warning along the follow line warn you be hydrate output that be not create by reactdomserver rendertostre perhaps you be use reactdomserver rendertostaticmarkup or modify the output after render please see for more information which version of react and which browser os be affect by this issue do this work in previous version of react 16 1 1 due to the change in 16 this work before
facebookreact
warn if this state be set to this prop referentially
Enhancement
see this example issuecomment 345464797 I think it probably reflect a misunderstanding of how prop and state work and we should detect and warn if we see this
facebookreact
move mousewheel event type detection to browsereventconstant
Enhancement
I think we can move the wheel event support check in browsereventemitter l126 l135 into browsereventconstant that run the check once which be nice for wheel and scroll event which eventually need to be attach locally file this for myself as a part of but this could happen on master right now more or less I m interested in cut the overhead of event listen as much as possible and this be really low hanging
facebookreact
control input don t work in safari
Duplicate
I originally think this issue be just around use but upon dig far it appear that safari just plain doesn t like control input whatever you type will appear in that input you can see this in action here now I will say that we work around this for the time be by leverage onkeypress instead of onchange which allow we to stop the event propagation we re all on safari 11 0 1 so I m not sure if this only affect safari 11 from look at old issue it look like this be a solve problem for safari 10 x but I don t have it so I can t confirm that or not
facebookreact
add validation to the react child helper
Enhancement
currently helper like react child toarray will not validate the pass element so thing like miss key go unnoticed see the discussion in I delete the original tweet for more context
facebookreact
inline style with decimal number
Bug
do you want to request a feature or report a bug bug what be the current behavior if the style prop be pass a decimal number react convert the dot in a comma result in an invalid css value I suspect this might be due to my locale be different from english but the behavior should be the same irregardless of the user s locale and the conversion be correct if I use string 12 34 if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem what be the expect behavior decimal number should be always convert with a dot which version of react and which browser os be affect by this issue do this work in previous version of react react version 16 x 0 os macos 10 13 1 browser chrome 62 safari 11 0 1 firefox 58 0 beta 1 be unaffected
facebookreact
warn when component have proptype rather than proptype
Enhancement
see issuecomment 343402728 feel like an easy mistake to make and easy for we to detect
facebookreact
unnecessary re render under bail out component when a legacy context provider and a deep child be update in the same batch
null
this issue be go to start off mostly theoretical as I m still work to make a minimal repro case we have a scenario where one component be have shouldcomponentupdate return false to bail out but a child component be still have its render method call avoid many detail this be roughly what we have jsx import react component from react class a extend component shouldcomponentupdate nextprop const result boolean nextprops item console log a shouldcomponentupdate result return result render console log a render this prop item return class b extend component state second 0 componentdidmount this interval setinterval this setstate second this state second 1 1000 componentwillunmount clearinterval this interval render console log b render this prop item return this prop item name this state second second export default a while this case do work as expect it seem to be in the direction of the error we re see there be something take place in our render cycle where b be be render without reuse the item prop from the previous reconcile my first question be be there any theory on why this may be happen that I can explore we be use context as the parent of a and as b and these be read from a flux thing I think a fork of the original oss flux they they these be both pass all prop through and not have any naming collision I m fairly certain we be not perform any mutation on our end if I do manage to pull off a repro case I will immediately post it here with utter joy in my heart cc acdlite gaearon this be the issue I be ask about in messenger recently
facebookreact
setstate callback call before component state be update in react shallow renderer
Bug
do you want to request a feature or report a bug report a bug what be the current behavior when I call setstate with a callback in a test use react shallow renderer via enzyme the callback get call and this state be still the old state edit this seem limited to componentwillmount if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 edit reproduce with this what be the expect behavior when the setstate callback get call it should have access to the new state which version of react and which browser os be affect by this issue do this work in previous version of react version 16 it work in v15 with enzyme 2 edit I think this be because in componentwillmount this line l67 cause the render method in the shallow wrapper to return early before it update the state
facebookreact
remove support for cloneelement getmountedinstance in shallow renderer
Bug
there be a test add as part of shallow renderer rewrite 9426 in that I don t understand it test that you can take an instance call cloneelement on it and pass the result to the shallow renderer if we be do this internally this seem like a misunderstanding of how the api should work and we need to fix those callsite to read getrenderoutput instead of getmountedinstance you can see the test be wrong because if you change it to render to a different shallow renderer like this js const shallowrenderer createrenderer let result shallowrenderer render expect result toequal foo bar const instance shallowrenderer getmountedinstance const shallowrenderer2 createrenderer const clone react cloneelement instance foo baz result shallowrenderer2 render clone expect result toequal baz bar it will fail with typeerror can not read property prototype of undefined the argument we re pass in this case be not a proper react element and doesn t actually have element type it just mostly happen to work because both react element and shallowrenderer instance have prop on they and code almost doesn t read anything else in the update path this be an example hack l147 l148 that we need because of this I think we should just delete this test and fix the internal callsite it be never intentionally support and prevent I from do some other fix in the shalllow renderer
facebookreact
a function that be also an iterable be treat inconsistently
Bug
do you want to request a feature or report a bug bug I think what be the current behavior here s a codesandbox or just plop this in an index html html what be the expect behavior I expect that thing will render the same regardless of whether they re an only child or a member of an array of child which version of react and which browser os be affect by this issue do this work in previous version of react yes it work in react 15 suggest solution I m fairly confident that the issue be in the array of child case the getiteratorfn call l578 l586 be within a typeof newchild object newchild null if statement whereas the original reconcilechildfiber l1358 put the getiteratorfn call outside it l1434 l1441 if I m not mistaken a simple fix would be to move this curly brace l589 a few line up wink I m happy to do so complete with a test give a little direction like where the test should go thank
facebookreact
show a well warning when accidentally return from constructor
Enhancement
base on a conversation with vjeux I write js constructor prop return something false instead of js constructor prop super prop this state something false and the error be super confusing it tell I that render be not define on the component which didn t make sense since I return it we can fix this to show a different message if type have prototype isreactcomponent but constructor give we something without a render method
facebookreact
ondrop break onselect event
Bug
do you want to request a feature or report a bug bug what be the current behavior after an ondrop event have fire inside an editable element input textarea contenteditable the onselect event on that element will no long fire when change selection use the keyboard as you can see in this gif below the onselect event get call each time I move the cursor around use the arrow key but once the ondrop event have fire onselect will no long fire when I move the cursor around also use the key react onselect bug here s the jsfiddle I use to record the video above what be the expect behavior the onselect event should always fire when selection change which version of react and which browser os be affect by this issue do this work in previous version of react react 16 chrome 62
facebookreact
invariant that don t have error code yet be miss in production build
Bug
see my comment in issuecomment 338974574 I verify introduce this regression
facebookreact
react spread operator be still in the official documentation
Question
bug in documentation what be the current behavior react s spread operator be remove in react 16 but it be still in the documentation spread attribute what be the expect behavior a word of caution should be include that this do not include react 16 maybe also add other way of spread prop which version of react and which browser os be affect by this issue do this work in previous version of react react 16 it work in previous release
facebookreact
branch on tag before do type checking
Enhancement
follow up for r145577198 this be neat but it also mean that we re sometimes compare string to number symbol that could potentially deopt the type hint in this function it might actually be well to check the child tag to ensure that it be a hostcomponent or fragment and compare the type in separate branch in fact that might already be a bug incase we ever add string to fiber type on other fiber than hostcomponent by check for tag before we do type comparison branch we can ensure we don t have possible bug from this as well as optimize type hint by have monomorphic function
facebookreact
react art on npm be miss the lib folder
Bug
it seem like those be intend to be public apis but they re not publish on npm because lib folder be not in the file whitelist
facebookreact
shallow test renderer call shouldcomponentupdate on forceupdate
Bug
there be no extra guard or clause in enqueueforceupdate when call render which mean the render always call shouldcomponentupdate which can block even force re render during test this for example break shallow rendering in enzyme when use mobx and observable minimal test case javascript import react from react import shallowrenderer from react test renderer shallow const renderer new shallowrenderer class testcomponent extend react component render return describe forceupdate it do not call shouldcomponentupdate let call 0 testcomponent prototype shouldcomponentupdate call 1 const component renderer render renderer instance forceupdate expect call tobe 0 this throw because call 1
facebookreact
investigate the nest update overflow cause by coalesce
Bug
we have an internal issue t22633912 which manifest itself as an infinite nest update loop trigger our invariant trueadm investigate that it be introduce in and then fix in we don t however have any fail test relate to that even though we remove that coalesce implementation I feel like we need to investigate what happen and add a regression test to prevent the same issue from occur in the future it might also be valuable to think about any additional information we can surface in the error at least in development for example component name for last ten fiber that schedule an update
facebookreact
flow ify reactpartialrenderer js
Enhancement
it doesn t have a flow annotation we should start flow ifye it to avoid bug like iamdustan wanna take it
facebookreact
react 16 mismatch html warning log when hydrate portal render to document head
Question
do you want to request a feature or report a bug bug what be the current behavior render a portal to document head on the server cause react to log a warning on unexpected markup while hydrate server markup currently this happen when use react head if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 I m not sure if it s possible to simulate this in jsfiddle since it require server rendering and access to document head but a fairly minimal repro case be in react head s example app which you can clone and run via do the follow git clone tizmagik react head git cd react head npm install npm run dev open you ll then see the react warning log if you have thought on a simple way to repro this happy to do that as well what be the expect behavior it s entirely possible that this be just a usage of react portal that wasn t anticipate but I m not sure if this be an invalid use case would like to get your thought and if there s a well approach than what I m currently do with react head besides the warning the module app seem to function exactly as expect at a high level this be how react head work during server render tag e g etc be collect in an array l41 which be rendertostre d and place in the server template l39 then on the client these server render tag be queryselecte and remove l20 l30 to be replace by reactdom createportal l38 in order to support spa functionality from then on here s the issue in react head which version of react and which browser os be affect by this issue do this work in previous version of react react 16
facebookreact
shallow renderer subsequent setstate call inside componentwillmount discard the previous one
Bug
what be the current behavior if componentwillmount have multiple setstate call only the last one work in shallow renderer if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem here dom renderer correctly render hello world while test shallow renderer render undefine world which version of react and which browser os be affect by this issue do this work in previous version of react issue be introduce in react 16 the reason must be those line replace publicinstance state with this renderer newstate should fix it l212 l215
facebookreact
autofocus doesn t work with ssr in react 16
Bug
work on the client but not when hydrated that s because this use to be implement in js as a special case but hydrateinstance doesn t cause a commit effect to be schedule that can call focus like finalizechildren do the question here be should we even bother implement this in js anymore or should we just emit the autofocus attribute in ssr and let the browser take care of it
facebookreact
typeerror can not read property create of undefined when use react test renderer
Question
do you want to request a feature or report a bug bug what be the current behavior try to run a simple jest snapshot test but fail on react test renderer if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 import as react from react import header from component header headercontainer import renderer from react test renderer test header be load correctly const component renderer create let tree component tojson expect tree tomatchsnapshot when run jest throw the follow error header be load correctly typeerror can not read property create of undefined at object src test unit header test tsx 6 31 at promise at at process tickcallback internal process next tick js 188 7 header be load correctly 144ms what be the expect behavior snpashot test should pass which version of react and which browser os be affect by this issue do this work in previous version of react react test renderer 16 0 0 react 16 0 react dom 16 0
facebookreact
onchange get execute only once react 15 6 1
Duplicate
do you want to request a feature or report a bug bug what be the current behavior react 15 6 1 onchange get fire only once reproduce bug link if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 what be the expect behavior onchange should get execute as maany time as we select radio button which version of react and which browser os be affect by this issue do this work in previous version of react 15 6 1
facebookreact
onmouseenter trigger on child in react 16
Bug
hi I m have an issue with onmouseenter be trigger on child of a component it only occur with react 16 I ve create a codepen that show the issue simplify structure be as below be a component that need to capture onmousemove event and trigger a render and be a simple component that wait for an image pass as a prop to be load before display it use onload on an image create in the constructor if you open the console you ll see that onmouseenter be trigger when hover normal behavior but also when hover the text div which be not suppose to happen if you remove the whole onload logic from the element then onmouseenter work as intend it s possible that I m code this in a way that isn t appropriate but it do look like a bug anyway
facebookreact
update prop in commitupdate
Question
give an instance which contain some object attempt to update that object in commitupdate result in an error since the object be freeze what be the correct approach to set the new prop to an instance in commitupdate I see in the art renderer for example it set the property on the instance directly e g l152 be that the correct approach be there no ability to wrap these change property in a container object
facebookreact
deduplicate the can only update a mounted or mount component warning
Enhancement
note anushreesubramani be work on this please don t send prs if you aren t her similar to anushreesubramani wanna take this one as well it would need to deduplicate base on owner stack info similar to how work
facebookreact
dom test fixture add caveat for ie9 range input and other unsupported thing
Enhancement
it can be confusing to recall that the range input type be not support in ie9 invalidate a few of our test case for example this test case verifie that change a range slider with arrow key work as expect however it look like a standard input in ie9 if we plan to make these test fixture more public I wonder if it would be worth add some caveat language or mark a test as invalid for a certain browser maybe this would be annoying but I think it might be nice to collect the opinion of other
facebookreact
check for raf polyfill lazily
Enhancement
case like issuecomment 334475000 can be pretty confusing we should probably move the warning to happen during first reactdom render rather than immediately
facebookreact
asynchronous componentwillunmount in react 16
Question
in react 15 componentwillunmount call first before the rendering of next component in dom in the current version v16 componentwillunmount be call after the mounting of next component it create an issue with my exist code since I reuse the same component after the history change so it invoke the componentwillmount with new prop and change in url and thereafter it invoke the componentwillunmount of same component be there still a way to do this in a synchronous way
facebookreact
ssr reactdom client and server handling newline differently cause mismatch warning
Bug
bug report I notice a warning text content do not match warning on certain page of my isomorphic react app use react and reactdom 16 0 0 after boil it down to a simple test case it seem that different kind of newline be handle differently some fail to match if I do let test foo nbar test everything be fine no mismatch error and the word be separate in the browser however if I do let test foo rbar I get warn text content do not match server foo bar client foo bar except in the js error console the second foobar read as one word this seem to be a chrome issue mishandle single r carriage return try x a rb and it echo that string to the console as one word in the browser I see foobar as one word more importantly though if I do window newline let x foo r nbar the result in my app be warn text content do not match server foo bar client foo bar which definitely seem like a bug in react s reconciliation logic setup full list of npm dep dependency babel plugin transform object rest spread 6 26 0 babel preset es2015 6 24 1 babel preset react 6 24 1 babel register 6 26 0 express 4 15 3 json bigint 0 2 3 moment 2 18 1 pm2 2 7 1 react 16 0 0 react dom 16 0 0 request 2 81 0 request promise native 1 0 4 this be a node express app on node 8 4 0 browser be macos chrome 61 0 3163 100 workaround preprocess any text that s user upload content to normalize the newline
facebookreact
make undefined ref message well
Enhancement
as report in it could ve be clear
facebookreact
allow suppress error boundary log from intentionally throw catch error
Enhancement
this be a repost of by erikra do you want to request a feature or report a bug somewhere in between what be the current behavior when I m run test on my library there be some behavior that I want to test do throw an error these currently result in consider add an error boundary to your tree to customize error handle behavior you can learn more about error boundary at be output to the console this error be great in an application but not so great for a library test what be the expect behavior it would be great if I could do something like jsx expect testutil renderintodocument tothrow bad developer andcatch prevent react 16 error boundary warning please provide your exact jest configuration and mention your jest node yarn npm version and operating system see also issuecomment 334164834
facebookreact
deduplicate the warning about function not be valid child
Enhancement
same as but for this one
facebookreact
even though I be use the webpack uglifyjs plugin for minification reactdevtool be tell I that I have unminified code that be not production quality
Question
do you want to request a feature or report a bug bug what be the current behavior reactdevtool be show the red icon for my deploy application even though I be use the webpack uglifyjs plugin and the webpack defineplugin with process env node env json stringify production if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template for react 16 template for react 15 what be the expect behavior that react devtool would show I a black icon indicate production quality code which version of react and which browser os be affect by this issue do this work in previous version of react I be use the late version of google chrome version 61 0 3163 100 official build 64 bit and this app be run with react 15 6 1 and react dom 15 6 1
facebookreact
deduplicate render method should be pure warning
Enhancement
note the task be already claim just see this in a fiddle that have a nest update bug it would be nice to just dedupe they in the first place instead of call console error a thousand time note the task be already claim
facebookreact
can not read namespaceuri of null error when render into a comment
Bug
see internal task 22198152
facebookreact
relationship between render updatecontainer and requestanimationframe
Question
this be highly related to when I call reactdom render or more accurately updatecontainer from within a renderer it seem the callback param be call somewhere in between update and render specifically if the callback be itself be a call to updatecontainer e g a recursive approach I get an error of flushsync be call from inside a lifecycle method it can not be call when react be already render tangential note this happen even if updatecontainer be trigger elsewhere like deferredupdate flushsync may be a bit misleading can someone please explain this a little more what do the order look like between updatecontainer and the callback my use case be as describe in the other issue but for the sake of clarity I d like to 1 call the top level render when the component have all finish render 2 rely on react s requestanimationframe timing rather than inject another one for trigger prop change 3 do all this without make the root node manage it via setstate componentdidupdate real world scenario be use react to drive animation via a custom renderer thank
facebookreact
svg image onload event not get dispatch on ie11
Bug
svg image element be not get onload event dispatch on ie11 example test with react 15 1 and 16 0
facebookreact
deprecate and remove testutil mockcomponent
Enhancement
it be a jest ism that shouldn t be in our open source package people use jest can implement a similar pattern directly
facebookreact
fiber can not render to documentfragment shadowroot
Bug
do you want to request a feature or report a bug bug what be the current behavior react 15 x be able to render within a documentfragment shadowroot not possible with fiber anymore demo js import react component from react import render from react dom class mycomponent extend component render return hello from react class myelement extend htmlelement static be my element constructor super const shadowroot this attachshadow mode open try this fail render shadowroot catch e console error e shadowroot innerhtml e see console log for stack trace connectedcallback console log myelement mount customelement define myelement be myelement relate what be the expect behavior be able to render to shadow root like previous version of react which version of react and which browser os be affect by this issue do this work in previous version of react react 16 chrome
facebookreact
reset of select ignore defaultvalue
Bug
do you want to request a feature or report a bug I report a bug what be the current behavior when reset a form which contain a select with a defaultvalue the select option become the first option element in the list not the one with value defaultvalue if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template I have put a piece of code here 0 click on the reset button which just do a form reset on the form what be the expect behavior I expect the select to select the option with value defaultvalue like apply a form reset on a which version of react and which browser os be affect by this issue do this work in previous version of react react dom 15 6 2 it seem to be browser independent try with chromium 61 and firefox 55 for fedora I didn t try this on prior version of react
facebookreact
react 16 fail to rehydrate noscript
Bug
do you want to request a feature or report a bug bug what be the current behavior as of react 16 s be not properly rehydrate equivalent code work in react 15 if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template consider the following server side code js const react require react const reactdomserver require react dom server class main extend react component render const component react createelement strong hello const content reactdomserver rendertostaticmarkup component console log content content return react createelement noscript dangerouslysetinnerhtml html content null function createapp return react createelement main null console log reactdomserver rendertostre createapp this code work fine in react 15 and 16 alike the output be similar react 15 content hello hello react 16 content hello hello now consider the follow application jsbin html hello in react 16 this display the following in the console log content hello err warn prop dangerouslysetinnerhtml do not match server strong hello strong client hello log initialize if you swap the comment block in the html so that react 15 be use the code work just fine there be no warning this be true regardless of whether you change the content of div target from the react 16 output to the react 15 output the error message confuse I it state that the server output be strong hello strong but this be not consistent with the output of the server side code neither the content nor the final markup emit have html entity please note that this be important because it break the only know workaround workaround to 1252 workaround issuecomment 246161590 I believe that this may be specific to noscript s because if one replace all occurrence of noscript with div then the example work fine in react 16 what be the expect behavior render a component with rendertostre and then rehydrate that component verbatim should not yield an error which version of react and which browser os be affect by this issue do this work in previous version of react regression from 15 to 16 test in chrome v61
facebookreact
doesn t work
Bug
see the original report in issuecomment 333242375 the problem be that svg be case sensitive and so na vely set tabindex and rely on insensitivity win t work with it the good news be it seem like tabindex be the only valid svg attribute with this problem we just miss it because it apply both to html and svg I think the fix be to add it back to the whitelist
facebookreact
how to prevent react from modify element manipulate by external code
Question
the new york times be rebuild its website use react currently it s an isomorphic app that have both server and client side render our question what s the good way to include a non react interactive graphic map chart and other visualization create by custom code within a fully react page our ideal scenario server side react render the initial html for a graphic use dangerouslysetinnerhtml as part of a react page client side react never touch those element again even during component mount we think react 16 might solve this with hydrate method but it still remove node that it doesn t expect such as node generate by d3 or other client side code none of the option in integrate with other library seem to be an exact match either the classic use case be a graphic with a d3 map the server side html include text and a placeholder for the map as well as the map js on page load the map be immediately draw by d3 but get erase when react mounts client side the d3 nodes aren t include in the server side output because they often vary base on viewport device etc here s a trivial example show react 16 s hydrate remove client create node after one second on mobile device load the react library and potentially other dependency could take some second the simple solution I can think of be a shouldcomponentmount function where we could return false the rest of the react component on the page would mount but leave the interactive graphic part alone there be probably other solution constraint we need to use dangerouslysetinnerhtml because we need to deploy graphic outside of site release we need to render the initial html server side for performance and simplicity we can t use iframe for everything as they re not flexible enough we can t re render or reattach element as that cause many problem css animation restart medium playback be interrupt input cursor and text selection be lose etc any guidance be appreciate cc gaearon leeb
facebookreact
umd production build define global variable
Bug
do you want to request a feature or report a bug bug what be the current behavior the umd production build link in the announcement define global variable y and nb react dom if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem via or similar template use the build with an app that define the function or variable y load before react what be the expect behavior react build should not define any other global symbol other than react which version of react and which browser os be affect by this issue do this work in previous version of react 16 0 0 it work fine with some beta of 16 0 0
facebookreact
in react 16 onmouseenter be trigger an extra time when enter a new child
Bug
version description onmouseenter onmouseenter demo js import react component from react class demo extend component constructor prop super prop this enter this enter bind this this state flag false enter event console log event nativeevent console log enter click this setstate flag this state flag render let old height 100px width 100px border 1px solid 6dbbff let aa height 100px width 100px border 1px solid red let content border 1px solid black display flex padding 10px return this state a old old this state flag new click I
facebookreact
website side nav sometimes show an incorrect current highlight
Bug
bug the active navbar item be incorrect sometimes reproduction step navigate to observe that synthetic event be highlight expect behavior quick start handle event should be highlight
facebookreact
react 16 do not lowercase html attribute in generate html
null
do you want to request a feature or report a bug bug what be the current behavior reactdomserver generate camelcase markup for the cellspace and cellpadde attribute here s an example pen I believe these attribute be canonically lowercase if I lowercase the attribute in jsx react warn that I m not use the right name warn invalid dom property cellpadding do you mean cellpadde what be the expect behavior the attribute name would be render lowercase which version of react and which browser os be affect by this issue do this work in previous version of react this be in 16 0 0 prior version of react strip these attribute
facebookreact
warn stateless function component can not be give ref attempt to access this ref will fail null after update to react 16
Bug
do you want to request a feature or report a bug bug what be the current behavior page load throw console error warn stateless function component can not be give ref attempt to access this ref will fail null chrome console 6vm598 27 warning stateless function component can not be give ref attempt to access this ref will fail null window console error vm598 27 printwarning warn js 36 warning warn js 60 mountindeterminatecomponent react dom development js 10488 beginwork react dom development js 10647 performunitofwork react dom development js 12621 workloop react dom development js 12730 callcallback react dom development js 1319 invokeguardedcallbackdev react dom development js 1358 invokeguardedcallback react dom development js 1215 performwork react dom development js 12848 batchedupdate react dom development js 13292 performfiberbatchedupdate react dom development js 1666 stackbatchedupdate react dom development js 1657 batchedupdate react dom development js 1671 batchedupdateswithcontrolledcomponent react dom development js 1684 dispatchevent react dom development js 1894 what be the expect behavior no console error or at least some way to trace which be the stateless component that be cause the issue which version of react and which browser os be affect by this issue do this work in previous version of react react 16 0 0 rc 3 chrome version 60 0 3112 113 official build 64 bit macos sierra 10 12 6 this error only start to appear after upgrade from react 15 16