repository
stringclasses
156 values
issue title
stringlengths
1
1.01k
labels
stringclasses
8 values
body
stringlengths
1
270k
facebookreact
display a warning if component be call without prop
Enhancement
do you want to request a feature or report a bug this be a feature enhancement what be the current behavior prop parameter isn t validate in component and purecomponent omit prop be a common mistake that result in undefined this prop in constructor this may result in a problem js class mycomponent extend component constructor super this state a 1 b this prop b can not read b property of undefined a problem may be hard to determine if previously work code stop work when refactore js class mycomponent extend component constructor super no error componentwillmount rewrite this to constructor code will result in situation above this setstate a 1 b this prop b what be the expect behavior component and purecomponent validate prop parameter to be an object or argument 0 at least and display a warning in development mode in case prop isn t pass from child constructor which version of react and which browser os be affect by this issue do this work in previous version of react react 16 7 0 alpha 0
facebookreact
improve message dispatch usestate be not a function when mix react next with
Enhancement
do you want to request a feature or report a bug report a bug what be the current behavior get typeerror dispatch usestate be not a function when try to call usestate this be happen in a create react app as well as in the codesandbox example below example what be the expect behavior usestate hook function should execute without error as define in the api documentation usestate which version of react and which browser os be affect by this issue do this work in previous version of react react v16 7 0 alpha 0 react dom 16 5 2 csb 16 7 0 alpha 0 local react script 2 0 3 csb 2 1 0 local
facebookreact
case where hook don t currently provide a good answer vs hoc
Question
unsure if this be the right place so try it out I ve notice that the new react hook feature be aim at provide an alternative composition pattern to hoc and render function but I believe that many of the use case solve by hoc at the framework level can not currently be address by the new hook api specifically there be not way to incorporate react hook with react memo unless I be incorrect this mean that any system that would like to implement optimisation base on external context such as the react redux connect function that use mapstatetoprop to implement an efficient shouldcomponentupdate will still need to rely on a hoc render prop to automate this optimisation the reason I be bring this up be because one of the main benefit state in the documentation be to reduce framework level use of hoc that pollute the tree of which the react redux connect hoc be probably the most prevalent use case additionally redux and useredux be specifically bring up as an exemplary use case although with the current system it will cause large optimisation issue since with no optimise shouldcomponentupdate every connect component will re render on every state change although this might fit into the documentation repo this be a discussion opinion and I do not feel it be a mistake that I should report but rather a discussion on importance an example solution for this could be if there be a way to use context in react memo which unless I m incorrect only have access to prop and prevprop
facebookreact
suspense doesn t resolve for subsequent time if be suspend again
Bug
do you want to request a feature or report a bug possibly a bug what be the current behavior repro demo github user search type one character and wait after the list be render everything work correctly subsequent fetch work this way type two character fast than result for the first character be render and fallback will never go although the second request be successful 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 suspense resolve with last resolve fetch and render the list of user which version of react and which browser os be affect by this issue do this work in previous version of react react 16 7 0 alpha 0 react dom 16 7 0 alpha 0 react cache 2 0 0 alpha 0
facebookreact
suspense ping shouldn t suspend if all suspend content be already in fallback mode
Bug
when use suspense and hook specifically usestate and useeffect nest async render use react cache cause state hook not to be update specifically this happen between the first promise settle and the last promise settle in a suspense component however the state update concern can be outside of the suspense root in the link example move the mouse will update the display coordinate for the first 2000ms the time at which the first throw promise resolve however after this the ui will not show any update coordinate until after the final nest promise in the adjacent suspense root settle I may both be use suspense wrong give the understandable lack of documentation as I ve be have other bug with this setup specifically the above example will sometimes never render beyond the loading placeholder this be especially noticeable with set high timeout in the timeout component react 16 7 0 alpha react dom 16 7 0 alpha react cache 2 0 0 alpha
facebookreact
safari devtool flood with security error on react dom selection work with iframe with diff origin
Bug
hey folk look like this code add small issue with safari and it could flood devtool console output with message like this as I understand it happen here diff a654f37b01573fc8006b426d56ad53cer50 and I see you catch the error but safari still add the error message if you have iframe with different origin
facebookreact
warn if reactdom createportal be inside a noscript or other text content tag
Enhancement
do you want to request a feature or report a bug bug what be the current behavior when call reactdom createportal from within a nothing happen no error be log javascript reactdom render reactdom createportal yo modalnode appnode what be the expect behavior whether warn that it doesn t work it work in the previous version render the portal which version of react and which browser os be affect by this issue do this work in previous version of react react 16 5 0 more recent reproducible in every browser repro
facebookreact
16 6 context api not work in class component
Enhancement
do you want to request a feature or report a bug quite possibly a bug or maybe confusion about the current api I be use the new context api as well as the new static contexttype in react 16 6 I be pass context down a couple component deep but when I attempt to access the context within the component the object be empty only the default value pass into createcontext be be display this be happen in a current feature I be work on at my job so I can not display that code but I do create a codesandbox with the gist of the problem here be a demonstration of the behavior I would expect to be able to access the current value of the context this way if those value change I would always have the most recent value now maybe this be expect behavior however it would be confusing if it be react 16 6 reactdom 16 6
facebookreact
react lazy defaultprop not merge into prop in commit phase lifecycle
Bug
do you want to request a feature or report a bug bug what be the current behavior in a component load use react lazy default prop be not merge into the prop object for these lifecycle componentdidmount componentdidupdate componentwillunmount getsnapshotbeforeupdate in shouldcomponentupdate default prop be merge into the nextprop argument but not this prop step to reproduce 1 create a component that have a default value for a prop use defaultprop 2 use that prop in one of the above lifecycle 3 load the component use react lazy 4 observe that the prop be not define in the above lifecycle codesandbox link what be the expect behavior default prop should be merge into prop for all lifecycle when use react lazy which version of react and which browser os be affect by this issue do this work in previous version of react react 16 6 0 react dom 16 6 0 window 10 firefox 63 0 window 10 chrome 70 0 3538 77 react lazy be not in previous version of react
facebookreact
suspense component should only capture if fallback prop be define
Enhancement
edit by acdlite decide in comment below that we will change the semantic so that a miss fallback prop mean the exception should propagate to the next parent like a rethrow that way a suspense component can specify other prop like maxduration without need to provide a fallback too do you want to request a feature or report a bug bug what be the current behavior do not warn you if you omit a fallback while redundant for ts flow usage I misspell the fallback prop by accident in a playground and be tear my hair out try to figure out why thing be not work as expect 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 omit a fallback what be the expect behavior react should warn during development if fallback be undefined which version of react and which browser os be affect by this issue do this work in previous version of react master
facebookreact
the gray overlay when tap the react root container
Bug
do you want to request a feature or report a bug bug what be the current behavior since seem that root element have onclick event handler with noop function in ios safari chrome browsers html element have gray overlay when tap on it the current behavior be that the whole root be blink when we tap on it the simple example to reproduce the issue be reproduce only in fullscreen mode root container be steel blue I suppose change come from here and the issue can be relate with which version of react and which browser os be affect by this issue do this work in previous version of react react 16 5 io 11 3 12 safari chrome
facebookreact
limitation of react createcontext
Question
do you want to request a feature or report a bug feature what be the current behavior the current behavior require end user to use createcontext in the module scope to my understanding it s not currently possible to use a default value derive from the state of a component a stateful provider in my case this stackoverflow post hit the issue right on imo I feel like this be the classic use case for replace redux and it doesn t work out of the box with static type I think it s quite tell that react redux be do something similar here diff 0d7275a0771455b7118505dedef42772r3 in their pr to move to react 16 context I would expect the default value to be this state of the provider component instead of null my knowledge of react internal be naive but I didn t see anyone else bring up this issue 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 desire behavior maybe a jsx api for context creation I imagine it s not quite that simple which version of react and which browser os be affect by this issue do this work in previous version of react 16 3
facebookreact
npm create react class no way to implement getderivedstatefromprop
Question
there seem to be no way to implement class method such as getderivedstatefromprop and a few other be I overlook something there be no mention of it here either
facebookreact
global window event be overwrite in react 16 5 in development mode
Bug
do you want to request a feature or report a bug report a bug what be the current behavior global window event be overwrite in react 16 5 in development mode here re minimal repro step react 16 5 2 in dev mode if you click the button you see domcontentloade event type what be the expect behavior the current behavior contradict with specify behavior window property event return the event which be currently be handle by the site s code outside the context of an event handler the value be always undefined moreover it work properly in production mode react 16 5 2 in prod mode it return expect click event type which version of react and which browser os be affect by this issue do this work in previous version of react it work properly in react 16 4 2 and prod mode react 16 4 2 in dev mode the issue be reproduce in chrome 69 it work properly in ff 62 window event isn t support in 62 however it should be reproduce in ff 63 it be recently add see detail browser compatibility it seem that the issue be introduce by conradirwin in 11696
facebookreact
16 5 with well support of iframe have some side effect
Bug
do you want to request a feature or report a bug bug what be the current behavior when transition from a state have an iframe inside a component to a state without that say iframe we have an error at setoffset node offset because node ownerdocument defaultview be null 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 work on it what be the expect behavior should not break which version of react and which browser os be affect by this issue do this work in previous version of react affect since this 16 5 0 come from this pr exactly diff 26d90cba6ee597ef475fa80dcf76ae1d getoffset as a check on ownerdocument default fallback to window but setoffset do not be there a reason why
facebookreact
feature request add dom to life cycle hook
Question
currently it s not very straight forward to get your hand on a component full dom in particular if it return multiple element in that case reactdom finddomnode just win t work so you re leave with ref but you ll never get the whole dom at once instead you get one element at a time you can of course do something along the line of this js class citylist extend component render this childelement let store this childelement push bind this childelement return this prop city map p componentdidmount access this childelement here but that feel a bit awkward hence my question be how about add the dom node render for a give component at the end of the argument list of the relevant life cycle event if I m not mistaken those would be componentdidmount getsnapshotbeforeupdate componentdidupdate and componentwillunmount as well as perhaps shouldcomponentupdate although I m not sure why that would be a good time to access the dom I haven t dig too deep into react s internal but my naive guess would be that this information should be available when those life cycle hook be be call on a more philosophical note it seem to I that store reference to the dom in the component just isn t all that clean in event handler you can use the event to reach into the dom and it seem to I that life cycle hook be practically destine to allow the same thank for your consideration
facebookreact
element attribute be remove silently in frameset tag
Question
do you want to request a feature or report a bug bug what be the current behavior in some historical reason I be still use obsolete tag frameset in my project and when I render my component which include frameset tag in react some attribute be ignore like row col could anyone tell I why and how to solve it by no hack way thx input javascript export default class obsoleteelment extend react component render return old page output javascript old page expect javascript old page which version of react and which browser os be affect by this issue do this work in previous version of react react version image node environment image image os image
facebookreact
miss umd variant of react profile min js
Bug
the 16 5 0 package release to unpkg currently have the production profile variant present for cjs build but there be no equivalent for umd build I e there be the file but there be no it would be great if a future release have the profiling variant package as umd as well also thank for the awesome framework
facebookreact
warn if react forwardref render function doesn t take exactly two argument be confuse when more than 2 argument
Enhancement
do you want to request a feature or report a bug a feature an improvement what be the current behavior when define more than two parameter for a react forwardref render function a warning message state forwardref render function accept two parameter prop and ref do you forget to use the ref parameter get log 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 option 1 overall the message could be more explicit on accept exactly two parameter also when the arity be great than 2 the second part of the message may be omit for instance forwardref render function accept exactly two parameter prop and ref option 2 if define more than 2 argument to the function be ok which may be the case since the real goal for this warning be just to make sure people use the ref parameter I think the message could not be show for arity 2 therefore chage the condition of 2 to 1 which version of react and which browser os be affect by this issue do this work in previous version of react 16 5 0 which be the one that include this new warning
facebookreact
pass react createcontext mistakenly as if it be an element cause confuse error
Enhancement
do you want to request a feature or report a bug bug what be the current behavior if you re really tired and forget to use a context provider and instead use the context as if it be a provider react understandably freak out but the error message be confuse I e js import react from react import reactdom from react dom const context react createcontext import style css function app return hello codesandbox duh const rootelement document getelementbyid root reactdom render rootelement this result in the console look something like paste from codesandbox warn a context consumer be render with multiple child or a child that isn t a function a context consumer expect a single child that be a function if you do pass a function make sure there be no trailing or lead whitespace around it warn a context consumer be render with multiple child or a child that isn t a function a context consumer expect a single child that be a function if you do pass a function make sure there be no trailing or lead whitespace around it the above error occur in one of your react component error in sandbox typeerror render be not a function could not consume error error 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 edit 1wv0ly494l what be the expect behavior an error that roughly paraphrase say something along the line of hey idiot you re try to use a context directly you want to use context provider go take a shower and try again which version of react and which browser os be affect by this issue do this work in previous version of react 16 3
facebookreact
ie9 unable to call apply on console error when encounter an unknown tag
Bug
this be introduce in react 16 5 0 if ie9 encounter an unknown html element in development react crash as it attempt to call console error apply here l30 this be reproduceable with the follow codepen code demo
facebookreact
interaction reference count decremente too aggressively
Bug
under certain condition we decrement the count attribute too often which can result in oninteractionscheduledworkcomplete be call prematurely and or more than once for a give interaction x track interaction schedule during sync render phase x do not double decrement suspense load within a sync render x do not decrement sync commit that be wait on suspense when the placeholder be past its expiration x properly decrement pende interaction count when a suspense resource load before its placeholder be show x add test with high priority render between suspend and resolve suspense state for both sync and async render
facebookreact
why we need both isbatchingupdate and isunbatchingupdate
Question
do you want to request a feature or report a bug question what be the current behavior imo from the naming isbatchingupdate should always equal isunbatchingupdate I wonder why we need both of they in 81224b diff 7a9f2b48de4b0ffcf7b436798ce9aaabr198 we add the isunbatchingupdate variable the comment say it s just for the weird case where the initial mount be synchronous and add a test diff c06dcc21e6553eb98915ab0eb50e4c7er314 for it but in a follow up pr diff 24152ba0b2ac251decb6a12f41bdf116l211 we just delete the comment but don t remove the isunbatchingupdate I don t know why we remove the comment seem the weird case which the before comment say doesn t be solve in this pr what be the expect behavior I try to remove isunbatchingupdate and use isunbatchingupdate instead just like before we do but encounter many test fail I think just few test would fail before try so could you give some clarification about this do we still need this now thank which version of react and which browser os be affect by this issue do this work in previous version of react master branch
facebookreact
access react component underlie dom tree
Question
do you want to request a feature or report a bug feature what be the current behavior form component have form field child input checkbox etc that be validate against some custom rule when form be submit validation work fine what be the expect behavior if the form be invalid I would like to scroll the page to the first invalid element after the form be submit but unfortunately component do not expose the underlie dom three except via the fiber object and I can not get the ref of any component which make scrolling not possible since I don t have the dom reference I be try to avoid ref forward on form field component because I would like the form to handle all validation relate code for encapsulation purpose and in case I want to publish this as a library for instance which version of react and which browser os be affect by this issue do this work in previous version of react react 16 4 0 be there any way to achieve this
facebookreact
node umd bundle be break on master
Bug
see pullrequestreview 150683126 we ll need to remember to fix it one way or the other before cut a release
facebookreact
update component that make resource request trigger update warning
Bug
do you want to request a feature or report a bug bug but more of a minor annoyance what be the current behavior tl dr update a component that make a resource request which trigger state update cause a warning to be display this description be base off of a modify version of the unstable async fixture example give a component that make a resource call which trigger react update js const someresource createresource fetchuserdata function userdetail prop another component be plug in to this resource so call read will trigger setstate call in that component const datum someresource read prop i d return datum when the resource request component be mount it be an indeterminate component during update it be know to be a functional component in both instance the component be call to get a return value the difference be that when it be know to be a functional component the renderer s phase be set to render before call the function js mountindeterminatecomponent const value userdetail updatefunctionalcomponent setcurrentphase render const value userdetail setcurrentphase null because the phase be set to render for the functional component we get a warning that react can not update during an exist state transition from warnaboutinvalidupdate if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem this be the unstable async suspense demo but have be modify to add a button to navigate the user detail for acdlite from any other user page 1 click on any user besides andrew clark the warning be only trigger when his data be not cache 2 click on the go to andrew clark button in the console there will be a warning about update during an exist state transition 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 master build
facebookreact
consider keep legacy context api for non state usage
Question
do you want to request a feature or report a bug feature request question accord to react doc there be 2 way to avoid pass prop through many level 1 new context api 2 composition inversion of control when use the new context api a consumer component must know and explicitly import a context this raise a quite big disadvantage compare to the legacy context api such component can t be reusable with different context unless make a prop only version of this component and wrap it with another one that use the context directly in fact it mean that a component can t be contextual and reusable by different context at the same time use composition in many case feel wrong for solve this quote the doc however this isn t the right choice in every case move more complexity high in the tree make those high level component more complicated and force the low level component to be more flexible than you may want example of a component I struggle to understand why it should now import a context javascript import as react from react import as propstype from prop type export class link extend react purecomponent static contexttype navto propstype any handleclick e e preventdefault const path this prop this context navto path render const path prop this prop return if it be already discuss or answer I apologize couldn t find any related issue
facebookreact
question on reconciliation
Question
I think I understand reconciliation in react however there be one thing I would like to clarify let s say on first render we render duke key 0 villanova key 1 and on next render connecticut key 0 duke key 1 villanova key 2 if I understand reconciliation correctly on the second render react will check that type e g and key of first two item from first and second render match hence it will add only the new item with key 2 to the new output hence generate follow result duke key 0 villanova key 1 villanova key 2 however I think this be not what react will generate and it seem then there be some issue with my understanding especially the bold part in the previous paragraph can someone explain what I miss in my understanding
facebookreact
react test renderer be possible to test lifecycle function
Question
do you want to request a feature or report a bug question what be the current behavior I be try to use react test renderer and I notice that the lifecycle method ex componentdidmount need to be fire manually render getinstance componentdidmount what solve my problem but reveal an other I want to use shallow render to test only the component under test but then react test renderer shallow api be minimal for render what be the expect behavior I be expect that react test renderer would support test my component reaction to the different lifecycle and be capable to use shallow rendering be there some way to use react test renderer in this scenario or be well I move to another library like enzyme
facebookreact
get key in react reconciler
Question
I be struggle to implement reusable view on mobile platform and to make it I need to get key value explicitly set and generate in react reconciler to match two different view tree somewhere outside react be there a way to achieve this thank
facebookreact
forwardref preclude use of composite component test util method
Enhancement
do you want to request a feature or report a bug bug I believe request to file a new issue per issuecomment 414868619 what be the current behavior when use reacttestutil that navigate the tree for composite component I be unable to find instance of component wrap in react forwardref jsx findrenderedcomponentwithtype tree myhocforwardedcomponent error find 0 instance if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem jsfiddle link here I have a hoc that return a forwardref pretty much exactly like the one write up in the doc forward ref in high order component except while use react context jsx const mycontext react createcontext somedefault const withmycontext component class mycontextconsumer extend react component render const forwardedref rest this prop return value return react forwardref prop ref withmycontext class myhocforwardedcomponent extend react component render return hello what be the expect behavior I would hope that we could still navigate the tree such that jsx findrenderedcomponentwithtype tree myhocforwardedcomponent be able to find the render instance which version of react and which browser os be affect by this issue do this work in previous version of react react 16 4 affect everywhere I believe thank you for the time
facebookreact
component prototype setstate callback be not receive any argument
Question
do you want to request a feature or report a bug bug what be the current behavior component prototype setstate s callback be not receive any parameter though line 47 in package react src reactbaseclasse js state that it will be call with the up to date component argument state prop context l45 l47 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 please check the console after click the button as it will display an empty array indicate that it doesn t get call with any parameter what be the expect behavior as the comment mention we should get the update state and prop and context as argument which version of react and which browser os be affect by this issue do this work in previous version of react I m check this behaviour in react v16 4 2 use chrome 68 mac os high sierra 10 13 6 and it also didn t seem to work in previous version though I didn t go back in the version history
facebookreact
how map render an array of element
Question
what be the current behavior react16 support return array component for example render return li 1 li li 2 li li 3 li export default arraydemo I want to map it with react child map for example import arraydemo from xxx xxx react child map arraydemo item index return col span 6 item col but arraydemo have become a single element react child toarray get 0 only what be the expect behavior I expect since react can return array how can I map it for sometimes I want to wrap each element in array which version of react and which browser os be affect by this issue do this work in previous version of react 16 4 or be I miss something important thx a lot
facebookreact
tool for end to end testing
Question
this may be a question moreso than a feature request but I can t seem to find the answer around the web it seem most people be work on small app or just ignore this as an issue I be work on a large react application and see some issue with end to end testing we have a webdriverio selenium setup which seem to be rather common from what I understand we use these tool to click some button type some text etc and then find the affect dom element and do some assertion however and here be where the problem be react do not synchronously perform all operation on the read dom it will use various method to schedule work which will be do asynchronously at some later time I have find that in our test a few assertion at random will see that the real dom be still in the previous state rather than the new state that result from have click the button and whatnot in every large test run I have not see many post on the internet even acknowledge this as an issue the one that I find that do only suggest add timeout throughout the test however for obvious reason this be slow and non deterministic be there a suggest way to know that a react application have finish perform all schedule work and if not be there a discussion about this happen somewhere
facebookreact
suspense fixture demo page scroll to top unnecessarily
Good First Issue
if you open that demo which live in this repo s fixture folder on a small screen tap one of the row at the bottom ex my name cause the page to scroll to the top immediately which mean you don t see the inline load indicator it should scroll to top after the data load but not before
facebookreact
host component outside the setstate path be sometimes unnecessarily diffe and update
Bug
extract from we re currently diff a host node in the complete phase even if it have bail out in the begin phase by itself this just mean we re do a little bit more work than necessary but it also have some observable effect in particular which by itself would be very rare and probably not worth fix be make bad because we end up commit update to input from another component I have a fix for this in file this for posterity
facebookreact
avoid reconciliation alternative component interface
Question
hello I want to ask a question about a way to avoid reconciliation process today I can see the follow process 1 component want to re render 2 component render method provide new virtual dom 3 some react diff library try to find some non optimal way to morph old virtual dom into new one please fix I if I be wrong I be not familiar with react codebase I can see an information in doc you don t have to worry about exactly what change on every update but your solution have complexity about o n or even bad so user should care about what change sometimes when user know what change he will be able to provide o log n or even o 1 solution for example I be work with huge data list and I be receive information from websocket about how to morph my list append prepend remove swap item etc I don t want to render huge component list and run reconciliation process for each mutation I can tell virtual dom how to morph efficiently append be there a way for user to provide morph method I can imagine some api like render be not define morph component if component append else prependto component find key 5 do you have any plan to implement it thank you please feel free to ask any question
facebookreact
might be time to update some of our package readme
Good First Issue
an npm package to get you immediate access to react without also require the jsx transformer this be especially useful for case where you want to browserify your module use react
facebookreact
profiler duration be sometimes incorrect
Bug
while work on the devtool profiler I ve notice that duration be sometimes incorrect this seem to be vaguely relate to high low priority state update need to track this down more so I m file an issue for myself
facebookreact
select multiple do not scroll to select item item
Bug
bug in react 15 we could set value or defaultvalue and select element scroll into view but in react 16 this do not work
facebookreact
if console error throw while report an error react can enter an invalid internal state
Bug
do you want to request a feature or report a bug bug what be the current behavior when reactfiberscheduler exceed the update count and throw the maximum update depth exceed invariant it do not update nestedupdatecount leave it in a dirty state this have be fix in this pr yet to be release diff 24152ba0b2ac251decb6a12f41bdf116r1478 but out of interest further concern I begin to explore issuecomment 403919095 some concern around whether reactdom fiber really maintain some state and in fact be leave dirty in at least some error case be indeed a concern or have be consider in the community while nestedupdatecount might be fix here I can t imagine it be the only state value which could have issue 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 repo with create react app which demonstrate my concern observe that you will have 2 test failure componentone be indeed poorly write but componenttwo be quite simple and should be ok skip componentone should should componenttwo pass what be the expect behavior only componentone should fail in my example which version of react and which browser os be affect by this issue do this work in previous version of react unclear
facebookreact
what be mean within the readme of create subscription by async limitation can it be clarify
Question
what be mean within the readme md of create subscription by async limitation for full compatibility with asynchronous rendering include both time slice and react suspense the suggest long term solution be to move to one of the pattern describe in the previous section the pattern describe above be redux flux store should use the context api instead I o subscription e g notification that update infrequently should use simple cache provider instead complex library like relay apollo should manage subscription manually with the same technique which this library use under the hood as reference here in a way that be most optimize for their library usage I don t think any of these suit our use case a high performance websocket stream that produce price quote which be render directly into component the application domain be a realtime trading application for an investment bank I be consult for ideally we want the price quote to be pass straight into the component with as little ceremony as possible this state will be transient so I don t see why I need to use some kind of state management solution to store it somewhere I don t think I should need to use react context and to then pass the datum down the tree since I can just import the service wherever I want in my code and pass callback into this to begin receive datum the latter seem simple with less ceremony and will make it easy to differentiate between different stream of price update it seem to I that create subscription be exactly what I need however the comment about async limitation worry I be there something I m miss could this be clarify in the readme be it because of priority I think ideally we wish the price update to be treat as if they be high priority because we would prefer to decrease the likelihood of client interact with stale datum
facebookreact
enzyme context api warning detect multiple renderer concurrently render the same context provider
Bug
do you want to request a feature or report a bug bug I guess what be the current behavior console error node modules fbjs lib warn js 33 warning detect multiple renderer concurrently render the same context provider this be currently unsupported step to reproduce the behavior 1 git clone 2 cd react context issue 3 yarn 4 yarn test 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 4 browser not affect because error be in node js open this because of issuecomment 402527012 issue happen because of enzyme code be unrelease so I copy paste it from master I m look for advice or some clue on how to fix this so I would be able to create pr in enzyme repo or in react repo if this be the case thank you
facebookreact
react test renderer shallow sfc should not get this
Bug
do you want to request a feature or report a bug bug what be the current behavior this address a bug in enzyme on this line l110 element type invoke the sfc with element as the this value I believe that this be need for create react class component but that there need to be a separate branch for sfc what be the expect behavior this inside a strict mode sfc will be undefined not the element which version of react and which browser os be affect by this issue do this work in previous version of react in all of react 0 13 0 14 15 and 16 this bug exist while the bug ideally will be fix I understand that it s highly unlikely that it would be backporte to the 14 15 line but I can wrap around it if there s a reliable way in those version to distinguish sfc from create react class component be there
facebookreact
add a more helpful message when pass an element to createelement as a type
Enhancement
this js createelement doesn t currently give a distinguishable message but we can easily detect it by check for typeof and in that case suggest something more concrete e g do you accidentally export jsx instead of a component
facebookreact
warn when setstate be a function that doesn t return
Enhancement
do you want to request a feature or report a bug I be propose add a warning in development what be the current behavior when I do this setstate bool bool bool this be valid javascript but be meaningless in react eslint no label help to catch this but we can probably do one well by build a warning into dev mode react itself sandbox demo what be the expect behavior warn when a function be apply to setstate that return undefine if the user want to indicate nothing change they should return null
facebookreact
pop ssr provider be o n where n number of provider on the stack
Enhancement
see for detail not sure if it matter in practice do people often have many dozen and more provider deep inside the tree if we can remove the loop there it would be nice
facebookreact
react dom throw referenceerror requestanimationframe be not define in ssr environment since 12931
Bug
do you want to request a feature or report a bug bug what be the current behavior the change seem to have break the server side rendering on master I m attempt to yarn start the fixture ssr to test and get the follow error from the server side when I load the localhost 3000 page referenceerror requestanimationframe be not define at censor react build node module react dom cjs react dom development js 5232 34 at object censor react build node module react dom cjs react dom development js 17632 5 at module compile module js 624 30 at module extension js module js 635 10 at object require extension anonymous function as js censor react fixture ssr node modules babel register lib node js 152 7 at module load module js 545 32 at trymoduleload module js 508 12 at function module load module js 500 3 at module require module js 568 17 at require internal module js 11 18 it point to this line js we capture a local reference to any global in case it get polyfille after this module be initially evaluate we want to be use a consistent implementation const localrequestanimationframe requestanimationframe what be the expect behavior no referenceerror in server side environment which version of react and which browser os be affect by this issue do this work in previous version of react not publish at the time of write node environment fixture ssr during server side rendering in response to a browser request
facebookreact
componentwillupdate discussion
Question
do you want to request a feature or report a bug feature componentwillupdate discussion what be the current behavior the current behavior call the function before re render the render target however there be no indication for when the re render method should be call 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 the expect behavior should call the function before re render the render target if there be no return conditional statement and if there be true should trigger the re render and false should not which version of react and which browser os be affect by this issue do this work in previous version of react 16 4 0 I have a few question before I try to solve this problem and it get reject I m assume that the team have decide to move in the direction of remove will update from react all together and have label they unsafe I ve see a lot of issue with those functionality before as well I be curious if provide a conditional statement inside those function would satisfy the unexpected render shouldcomponentupdate do trigger when to call these function however in those function that will run before the render can always be control with a conditional statement of it s own I m get comfortable with the code base however I m curious if the team be remove that functionality all together and use the static function getderivedstatefromprop instead have a react lover it be a little confusing and may break a lot of legacy code when update version I believe that may solve the problem of unexpected render after a will change lifecycle event I be curious if that be the case and remove will lifecycle be the next step for react then how will the do lifecycle work instead I love react and I m just curious about the future for react as a whole I d love to tackle any bug or feature request when I have time I will be write clean code and create test for new feature or bug as well
facebookreact
react context issue
Bug
do you want to request a feature or report a bug bug what be the current behavior one context consumer have a value of another contexts provider if the current behavior be a bug please provide the step to reproduce and if possible a minimal demo of the problem example js const react require react const rendertostre require react dom server const provider locationcontextprovider consumer locationcontextconsumer react createcontext location const provider basecontextprovider consumer basecontextconsumer react createcontext base const e react createelement const html rendertostre e locationcontextprovider value location e basecontextconsumer null basecontextvalue e locationcontextconsumer null locationcontextvalue e basecontextprovider value base e span null locationcontextvalue basecontextvalue console log 1st attempt html console log 2nd attempt html output 1st attempt location base 2nd attempt location location what be the expect behavior 1st attempt and 2nd attempt to produce the same result which version of react and which browser os be affect by this issue do this work in previous version of react react 16 3 16 4 all os the issue do not appear on version prior react 16 3 use the create react context polyfill note this issue be find while try to use ryan s new reach router and ssr which do something like the example above after communicate with he ryan open the follow issue on his repository
facebookreact
return an empty fragment throw a confusing error
Bug
render a component like js const foo throw the error foo nothing be return from render this usually mean a return statement be miss or to render nothing return null the error be confusing because clearly foo be return a value I don t know if we want to support render empty fragment but in any case this error be confuse if this isn t allow it should explicitly call out that a component can not return a fragment with no child cc gaearon
facebookreact
fire change event for change make to input before hydration
Enhancement
currently when hydrate server render markup we ignore change the user make before hydration we also don t reset their change once hydration finish the motivation there be likely to avoid lose user input see this test l543 l552 the problem with that be that it assume the value will continue to be change after hydration complete e g a user keep type if they don t then the dom and react will be out of sync we should try to detect if there have be any change make to an input when hydrate and if so dispatch a change event so that the component be notify of the new value see for some more discussion
facebookreact
onchange event doesn t trigger when direclty click on the maximum input type range value
Bug
do you want to request a feature or report a bug bug what be the current behavior when you directly after the loading choose the maximum value on the input type range the event isn t fire with an onchange the event be fire when it s not the maximum value of the input sandbox click on the maximum right of the input of type range there be no message on the console and the display value doesn t change as expect click on a other value on the input a message be display in the console and the value change when you click on the last value it s now display what be the expect behavior an event should trigger when you directly click on the maximum value of the input of type range which version of react and which browser os be affect by this issue do this work in previous version of react testing on macos high sierra firefox 60 0 1 safari 11 1 chrome 66 0 3359 181 react 16 2 0 to get around this behaviour I have to change onchange by oninput but add a blanck onchange to still get the drag behaviour on safari on iphone see this codesandbox
facebookreact
keep use legacy context api or how to achieve this with new api
Question
do you want to request a feature or report a bug more like a feature what be the current behavior so I be currently use the legacy context api very heavily a typical component tree in my app might look a bit like this js provide 3 object via context all child might need at some point might need one of the 3 object pass via context additionally provide 2 function via context need some object from need both function from and maybe some object from and so on and so forth you get the idea so I have a heavily nest component tree where I use context all the time to pass function boolean object or whatever without have to use prop all the time I be try to avoid prop drilling as much as possible additionally some of these context var might be set in lifecycle method after a first render or maybe after some hoc provide some datum it be basically all over the place what be the expect behavior my question now be I can t see any proper solution to achieve all this with the next context api it will be a huge pain in the a to achieve it and make some of my code completely unreadable be there any way to keep use the legacy context api maybe the react team could provide a extra package for that or maybe someone have a well idea on how to achieve this without have pretty bad prop drill all over the place look forward to your answer good patrick
facebookreact
suspense timeout expiration and sibling render issue
Question
do you want to request a feature or report a bug bug what be the current behavior code for reproducing be here I ve also deploy an example to zeit now this be a basic example of use react suspense and simple cache provider postpone text render and show loading spinner when it s necessary I can see my use of doesn t really care about ms I m pass it always become expire right after the render you can open a page and the loading bar appear immediately despite 1000ms delay that it have there be content that be place next to an async component the one that s go to be suspend l51 l56 look at react suspense test it be assume that sible element can be render in any way what be the expect behavior component only show placehold when expire sible content be show even if an async component be suspend I build source for react react dom and simple cache provider from the current master update enablesuspense flag I also use but it didn t seem to make any difference I overall be really satisfied with this feature I hope I do the code correctly so it show the real bug
facebookreact
question regard prop child
Question
do you want to request a feature or report a bug just question some question regard prop child in the official react documentation of react child reactchildren you can read that this prop child be an opaque datum structure what do that mean exactly I think there be in general three possibility for the transparency of the data structure of prop child case 1 every aspect of the prop child datum structure be open and well define if this be right then the term opaque datum structure would be completely wrong therefore case 1 obviously be not the case case 2 no aspect of the prop child datum structure be open or clear that would mean that whenever you use prop child you always have to use it in combination with react child as react child be the only one mmmh be it really the only one who know about the actual data structure of prop child but that would imply that it should neither be allow to use javascript this be use almost everywhere even in the official react documentation this prop child nor javascript this be often see with the function as child pattern mycomponent proptype child proptype func isrequire as both example be very common it seem that case 2 be obviously also not the case case 3 some aspect of the prop child datum structure be open and well define that would open the possibility that one or even both of the example in case 2 be valid but then it would mean that there should be an exact specification what aspect of prop child be well and openly define and which aspect be really opaque maybe I ve miss something in the react documentation but I think it s not really exactly specify there be it and last but not least a further question why exactly isn t prop child in case there be some child one ore more just always an array as it be do in preact for example that would make thing so much easy wouldn t it many thank in advance for the clarification
facebookreact
support pointer event
Duplicate
pointer event be currently unknown event handler property in react what be the current behavior this js fiddle show that attach the onpointerdown event to a div produce this warning in the console warn unknown event handler property onpointerdown it will be ignore in div create by app in app what be the expect behavior although pointer event be not support by apple feat pointer they be still useful to developer target other platform perhaps a good middle ground would be to allow they but print a console warning say they may not work happy to put together a pr if someone point I in the right direction
facebookreact
submit reset input lose text when value undefine
Bug
do you want to request a feature or report a bug bug what be the current behavior create an
facebookreact
unsafe lifecycle function can no long be define more than once via mixin
Bug
do you want to request a feature or report a bug bug what be the current behavior the unsafe lifecycle function alias in 16 3 2 be not merge when define more than once because of mixin trigger an error uncaught error reactclassinterface you be attempt to define unsafe componentwillreceiveprop on your component more than once this conflict may be due to a mixin to reproduce rename all cwm cwrp and cwu function with their unsafe version in a project where mixin cause those function to be duplicate what be the expect behavior that these lifecyle function continue to work as expect when call via unsafe alias in 16 3 and if they be not suppose to with regard to redefine merge that the migration path documentation be update to indicate so
facebookreact
react art react context api be not work correctly
Bug
do you want to request a feature or report a bug bug what be the current behavior when you use react art rendrer the consumer be pick up the default value define by the initial creation of the context rather than the value provide by provider actual behabiour shape have y 10 initial value javascript import react from react import render from react dom var reactart require react art var group reactart group var shape reactart shape var surface reactart surface var red dot path m12 5 17 c16 0898511 17 19 14 0898511 19 10 5 c19 6 91014895 16 0898511 4 12 5 4 c8 91014895 4 6 6 91014895 6 10 5 c6 14 0898511 8 91014895 17 12 5 17 z m12 5 17 const consumer provider react createcontext x 0 y 10 const app x y return render document getelementbyid root demo what be the expect behavior shape should have y 100 provide value v16 3 2 for react react dom and react art
facebookreact
defaultchecke prop set only check attribute
Bug
type inconsistency for common use case bug for project rely on correct dom emission description it s unclear to I if the following be a know issue or not take in consideration the snippet below jsx current behavior set the defaultvalue prop on input of other type set both the value and defaultvalue attribute on the dom element when set the defaultchecke prop on input of type checkbox only the check attribute be correctly set leave the defaultchecke attribute unchanged expect behaviour like mention above the expect behavior would be for the defaultchecke prop to set both the check and defaultchecke attribute on the corresponding dom node like it s the case with the defaultvalue prop
facebookreact
warn message recommend use soon deprecate lifecycle method
Bug
which version of react and which browser os be affect by this issue do this work in previous version of react react 16 3 1 what be the current behavior warning message recommend use soon to be deprecate lifecycle method componentwillmount warning content warning can not update during an exist state transition such as within render or another component s constructor render method should be a pure function of prop and state constructor side effect be an anti pattern but can be move to componentwillmount what be the expect behavior warning message should be inline with deprecation plan
facebookreact
use and set a component s state within setinterval function
Question
this be a question so I apologize if this isn t the good place to ask I m try to work with a component s internal state within a setinterval function and I know there be some asynchronous problem I need to be aware of I also know that I can pass setstate a function which would help I protect against async problem but I can t because I need to use the change state within the setinterval function be what I m do safe or should I be work a different way around this problem I ve see the following that nearly answer my question and be have trouble visualize adapt this or maybe the behavior I have be fine stackoverflow answer sectiontimerhandl const elapsedsectiontimem this state elapsedsectiontimem 1000 do some stuff with elapsedsectiontimem this setstate elapsedsectiontimem restartsectiontimer if this sectiontimeintervalid 0 window clearinterval this sectiontimeintervalid this sectiontimeintervalid window setinterval this sectiontimerhandler 1000 this setstate elapsedsectiontimem 0 or would something like the follow be well safe even though I m use this state elapsedsectiontimem 1000 early in the function this setstate prevstate assessmentstate return elapsedsectiontimem prevstate elapsedsectiontimem 1000
facebookreact
why be the consumer and provider property of consumer
Question
be there a high meaning for 1 consumer and provider both be property of consumer 2 and consumer being of type symbol react context and not react consumer while provider be of type symbol react provider jsx const mycontext react createcontext value mycontext mycontext consumer mycontext consumer consumer while this be convenient because I usually only use provider once as jsx import mycontext from mycontext and then I can do less type by simply use jsx import mycontext from mycontext I would be interested in know where if this be document and what be the preferred way whether to use the full or if it be legit to just simplify to
facebookreact
context api bitmask relate question
Question
I m play with context api bitmask feature to bail out unwanted re render I have a dynamic model a json object as context value by dynamic I mean the number of key and structure of the json object be unknown but when the json object change I know which key be change it seem difficult to turn the unknown key to static pre define bitmask but I think such use case be very common and the bail out feature should handle it easily by just match the key also I notice default changedbit and observedbit be max sign 31 bit int do this mean it have a limitation up to 31 type of context change
facebookreact
size prop be not attach to the dom
Bug
do you want to request a feature or report a bug bug what be the current behavior the size prop can only be a number and I think this should be true for input and select but not necessarily true for the rest of html tag or web component 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 sorry it s a codepen this example use a framework call onsenui that internally use web component in the onsenui framework there be an icon web component that transform every size prop value into a string which be not attach to the dom I know that the example have more dependency than react but there be also a simple div as simple as this which be also affect by this issue what be the expect behavior the size prop should be add to the dom when it be not a number on html tag that aren t input and select which version of react and which browser os be affect by this issue do this work in previous version of react the affect version be 16 3 it work ok in version 16 2 browser all
facebookreact
react test renderer create do not work properly with forwardref component
Bug
do you want to request a feature or report a bug bug what be the current behavior if you try to access the root of a component tree of a component create with forwardref you will get an error unexpected object pass to reacttestinstance constructor 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 a minimal example be simply a component create with forwardref js import react from react export default react forwardref hello now if you try to use create from react test renderer and access root you will get unexpected object pass to reacttestinstance constructor tag 14 this be probably a bug in react js import react from react import create from react test renderer import hello from hello it test forwardref component const tree create expect tree root what be the expect behavior you should be able to create component create with forwardref with the test renderer which version of react and which browser os be affect by this issue do this work in previous version of react 16 3 use jest forwardref do not exist previously
facebookreact
clone the child of a context consumer produce confusing warning and error
Question
do you want to request a feature or report a bug this be a bug or at least a request for more precise warning and error message what be the current behavior I be clone child to add some property and I overlook that the context consumer subtree should not be clone import react from react import render from react dom const provider consumer react createcontext const comp child clonekid child const clonekid child react child map child child react cloneelement child child prop child prop child clonekid child prop child render console log document getelementbyid root the code produce the warning and error introduce with 12241 warn a context consumer be render with multiple child or a child that isn t a function a context consumer expect a single child that be a function if you do pass a function make sure there be no trailing or lead whitespace around it and even more confusing typeerror render be not a function what be the expect behavior maybe react cloneelement should not attempt to clone function whatever it do the result be not a function the warn part a child that isn t a function should be separate from the other warning there can t be multiple child and one child that be not a function at the same time so a more precise warning can be issue which version of react and which browser os be affect by this issue do this work in previous version of react test with react 16 3 0 in stackblitz chrome 65 and react 16 3 2 in chrome 65 and firefox 59
facebookreact
unexpected behavior when use react forwardref with react createcontext
Bug
do you want to request a feature or report a bug bug what be the current behavior example if the logprop be child of m provider and m consumer be use in its child when the m provider be update even if the logprop be wrap in a component that never update it can still be trigger by the callback of react forwardref and update the logprop what be the expect behavior the logprop shouldn t update when the root component have update whether or not m consumer be use in its child which version of react and which browser os be affect by this issue do this work in previous version of react it s use
facebookreact
strange beahvior react new context api
Bug
I think it be a bug git with example npm I npm start go to dependency react v16 3 2 chrome v65 0 3325 181 component context orderdetailscontext root component ordersview simple component ordersviewrow subscribe component orderdetailsview problem application have one dynamic context orderdetailscontext and 3 component one root component ordersview and 2 child component ordersviewrow and orderdetailsview only one component orderdetailsview subscribe to dynamic context and have to be refresh once context datum be change but with they we have problem when context be change the subscribed component be not refresh and have old version of context datum actual orderdetailsview do not update once context be update expect orderdetailsview will update once context be update first solution go to ordersview and move orderdetailsview to the top of render function then subscribe component will be update when context be change image second strange solution go to separete component ordersviewrow and just remove remove this td and I will work then subscribe component will be update when context be change video reproduce 1 clone 1 npm I 1 npm start 1 open in chrome 1 open dev tool in chrome 1 click on view button expect loading text should be visible and hide after text should be update and new number should be display console log should be image actual loading text be not visible text be not change console log be image
facebookreact
improve warn message for failure to initialize state when use getderivedstatefromprop
Enhancement
do you want to request a feature or report a bug bug what be the current behavior the warning for a failure to initialize state when use getderivedstatefromprop be not as clear as it could be this component produce the warning mycomponent do not properly initialize state during construction expect state to be an object but it be undefined js class mycomponent extend react component static getderivedstatefromprop nextprop prevstate return null render return foo the warning can be resolve by add state either in the class definition or the constructor or by not use getderivedstatefromprop see for more detail on why this warning message can be count intuitive since the warning be specific l509 l510 to the use of getderivedstatefromprop and not trigger by any other state or lifecycle method and state initialization isn t require for other state method like this setstate it would make sense to I to mention getderivedstatefromprop explicitly in the warning here s a proposal for a new warning message mycomponent component state must be initialize when use getderivedstatefromprop expect state to be an object but it be undefined 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
facebookreact
have a context provider as root element cause rendertostre to omit datum reactroot from output
Bug
do you want to request a feature or report a bug bug what be the current behavior datum reactroot be miss from the generate string cause exist valid dom to be clear 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 the markup of the root element should have datum reactroot but it be miss which version of react and which browser os be affect by this issue do this work in previous version of react 16 3 2 not sure
facebookreact
onchange doesn t fire if a capture phase document listener for the underlie native event call setstate
Bug
do you want to request a feature or report a bug a bug what be the current behavior checkbox not fire onchange for control component it somehow relate to global event listener with setstate see sandbox example what be the expect behavior checkbox should fire onchange handler break example with react 16 work example with react 15 version
facebookreact
question context provider state initialisation
Question
consider a component wrap a context provider js class valuewrapper extend react component constructor prop super prop this state value null setvalue this setvalue setvalue value this setstate value render this prop child a consumer then might want to set a default value when it be first mount the only way I can see to do this use the new api be to check for an exist value on first render js class valueupdater extend react component state inputvalue 0 handleinputchange e this setstate inputvalue e target value render value setvalue if value setvalue this state inputvalue return setvalue this state inputvalue update value but this seem to break the golden rule of update state in the render method setvalue this state inputvalue as this would immediately cause a re render ideally I would be able to call the setvalue from the context in the componentdidmount method of the valueupdater component but with context as a render prop that s not possible as far as I can tell the doc suggest pass prop down to another component js render value setvalue but if I try to do the initialisation in the valueupdaterinput component s componentdidmount method it would be call on every render surely as valueupdaterinput would be re render each time be there a well pattern than this or be I try to use context inappropriately
facebookreact
multiple renderer should allow context
Enhancement
l51 we currently don t allow multiple renderer share the same context however we should relax that constraint they should be allow as long as render isn t interleave so when we pop the provider we should also pop the sigil we need this to run fabric and rn at the same time
facebookreact
reactjs logo license
Question
I have be unable to find out what the license for the react logo be do anyone know under which license it be
facebookreact
new context provider may block old context propagation if child be constant
Bug
do you want to request a feature or report a bug bug what be the current behavior it seem that if the child of a new style react createcontext context provider be constant the provider can block update from old style this context context provider from propagate to this context consumer this sandbox demonstrate the issue click the button with a number will correctly increment the root s state and context but the update be only propagate to the child3 s context and its button when the color button be click as it cause an update to the value of the new style provider copy of the source code in the sandbox jsx import proptype from prop type import react from react import reactdom from react dom class root extend react component constructor prop super prop this state count 0 this countup this countup bind this getchildcontext return this context count this state count countup this countup render return this prop child countup this setstate count count count 1 root childcontexttype count proptype number isrequire countup proptype func isrequire const ctx react createcontext class child1 extend react component constructor prop onclick void super prop this state color randomhexcolor newcolor this newcolor bind this render return this prop child newcolor const color randomhexcolor this setstate color function randomhexcolor const colorstr math floor math random math pow 2 24 1 tostre 16 return 000000 slice 0 colorstr length colorstr class child2 extend react component render return ctx color class child3 extend react component render return this context count child3 contexttype count proptype number isrequire countup proptype func isrequire reactdom render document getelementbyid root what be the expect behavior both old style and new style context update should coexist which version of react and which browser os be affect by this issue do this work in previous version of react 16 3 1 also break in 16 3 0 this seem to only happen if the child of the provider be constant which be what happen when the child be provide on the first and only reactdom render call if child1 be update to directly use instead of this prop child the problem do not happen this can also be a problem when use a production optimization that hoist constant element outside the component if the specify child be constant which would even defeat the fix workaround for the example above
facebookreact
react dom development bundle use array from
Bug
do you want to request a feature or report a bug bug what be the current behavior currently the 16 3 x version of react dom ship react dom development js contain usage of array from which be not available in certain react support browser like ie11 it cause breakage if those particular code path be take in such a browser I run into it use in ie11 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 reproduction should see hello world but ie11 will crash and show nothing what be the expect behavior react dom development js would not use array from or document that a polyfill be require 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 16 3 0 alpha 0 through 16 3 1 internet explorer 11
facebookreact
improve reactdom s uppercase html warn
Enhancement
do you want to request a feature or report a bug improvement request discussion what be the current behavior render in reactdom foobar be use uppercase html always use lowercase html tag in react what be the expect behavior the warning message can be improve to make it more obvious how to fix the issue for different use case for example it s not obvious from this message that custom component should add dash or that the first letter should be capitalize if it s actually a react component here s my idea but I m open to suggestion warning look like an html or web component element because it start with a lowercase letter but it have uppercase letter instead of dash use pascalcase for react component or lowercase letter and dash for html which version of react and which browser os be affect by this issue do this work in previous version of react master eb6e752cabafed0b72e1d0a38819ff156557d537
facebookreact
possible incorrect event target on number input in ie9
Bug
since react 16 0 0 it look like there might be a case where event target on a change event in ie9 report as the window but I can t reproduce it outside of the dom test fixture step to reproduce 1 open this build of the fixture in ie9 2 enter text into an input 3 observe that the event target value be the window as record by the fixture I can not reproduce this use the follow codepen viewable in ie9 here here s a diff of my change with master any idea what s go on here s what I think I need to check next x difference in raf polyfill x difference in map set polyfill this list will probably grow
facebookreact
warn in ie 11 when use react fragment
Bug
do you want to request a feature or report a bug bug what be the current behavior with react 16 3 0 when use ie 11 give the follow warning warn invalid prop child supply to react fragment react fragment can only have key and child prop step to reproduce 1 use create react app to create a new react app 2 add to app js for example import react component from react import logo from logo svg import app css class app extend component render return welcome to react to get start edit src app js and save to reload export default app 3 open the app in ie 11 4 open ie dev tool and refresh the browser 5 you should see the above mention warn message in the console window no warning with chrome firefox and edge what be the expect behavior there should be no warning show 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 browser ie 11 os window 10
facebookreact
error boundary bug
Bug
do you want to request a feature or report a bug bug what be the current behavior an internal error be raise when the error try to propagate uncaught typeerror can not read property return of null uncaught typeerror can not read property return of null at renderroot react dom development js 12223 at performworkonroot react dom development js 12764 at performwork react dom development js 12685 at performsyncwork react dom development js 12662 at requestwork react dom development js 12562 at scheduleworkimpl react dom development js 12437 at schedulework react dom development js 12397 at schedulerootupdate react dom development js 13025 at updatecontaineratexpirationtime react dom development js 13053 at object updatecontainer react dom development js 13072 what be the expect behavior error should propagate to error boundary which version of react and which browser os be affect by this issue do this work in previous version of react 16 3 0
facebookreact
bug new context api do not work with reactdom unstable rendersubtreeintocontainer
null
do you want to request a feature or report a bug bug what be the current behavior consumer render by invoke reactdom unstable rendersubtreeintocontainer invoke render function with default context value ignore value of provider 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 open example on codesandbox io 1 click increment state contextvalue state should change to 1 and childcomponent render directly will show it 2 click render into placeholder childcomponent render through unstable rendersubtreeintocontainer should show 1 actual result childcomponent render through unstable rendersubtreeintocontainer should show 111 which be default value specify in createcontext what be the expect behavior unstable rendersubtreeintocontainer should pass context through to consumer 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 chrome 65 x64 window 10 x64
facebookreact
uncaught error should be work on a root this error be likely cause by a bug in react
Bug
get this debug another error filing here for reference original code
facebookreact
backspace over word boundary cause cursor jump when input type be email
Duplicate
do you want to request a feature or report a bug bug what be the current behavior the input cursor jump to the beginning upon backspace over the final character or word that follow a space when the input type be email reproduce on jsfiddle the step the end user must take be repeat here enter a word space character e g test 1 in the input which have type email backspace to remove the last character or word follow the space observe the cursor jump to the beginning of the input box the issue do not occur with input type text I haven t try every other type of input yet what be the expect behavior the cursor should not jump even if someone mistakenly enter a space into an email input box and then try to backspace over it we should not confuse that person more by jumble their input which version of react and which browser os be affect by this issue do this work in previous version of react I have observe this with the late version of react 16 on the follow ios 11 2 6 safari macos 10 12 6 and 10 13 3 chrome 65 0 3325 181 and safari 11 0 3 window 10 1709 chrome 65 0 3325 181 the problem do not occur on window 10 1709 firefox 58 0
facebookreact
custom property name contain or get remove from custom component
Duplicate
this could be consider a bug or a feature request I say this because I know that react be check for w3c valid attribute property name not namestartchar but the check be run inconsistently between normal component and custom component which make its behavior confuse that mean this could be feature to be more explicit about its behavior for my particular use case this only need to be improve upon in react dom server I be try to render custom property like those belong to amphtml particularly the amp bind api which require and in property name I think that the check for valid attribute property name l79 l81 should only throw warning or it should have an option to prevent the removal of custom property example js js const customprop custom property hello world jsx js test test result html html test test this throw a warning only for the try it out in codesandbox
facebookreact
can not read property return of null
Bug
run into a strange issue that I can not reproduce it happen when run test in karma use 16 3 0 alpha 3 image the issue be here l864 l877 my test be throw an error because of a miss onchange handler when render a checkbox with check but no handler what appear to be happen be that nextunitofwork be not null and miss the first branch replayunitofwork be run after which nextunitofwork be null and sourcefiber doesn t exist and so access of return fail I ve try for a while to reproduce it the follow codesandbox be a simplified version of the code that be throw but the error isn t present there
facebookreact
be there a way to access new context api within componentdidmount
Question
we be build a react mapbox gl module and we use clone and inject prop today we be look into use the 16 2 0 context api but I see that it will have a new one on 16 3 0 but I can t seem to find a way to read context detail on componentdidmount lifecycle which make sense for I to use on the map implementation be there a way around this
facebookreact
keep the child mount but replace the parent
Question
hi I m try to do something like this const container prop prop somecondition prop child prop child const app prop basically what I want be a situation where app be rerendere on a change boolean prop imagine somecondition have an actual change value and a different container will render depend on its value while maintain the same child inside problem be that those child be do async fetch on didmount but they re mount and lose their state while the container change any idea how can I achieve this with the child still mount even if their parent change thank in advance
facebookreact
impossible to change classname
Invalid
I would like to change a class name to invoke a simple animation effect classname as an attribute must be a string when I run render it appear to do more than simply update the class as the animation doesn t run even with key set I also can t render once and then change the class as prop be readonly
facebookreact
question about settimeout effect of two react demo
Invalid
I be a react learner I m counfuse by two react demo demo1 demo2 demo1 js import react from react let num 0 export default class hello extend react component state loading false datum 0 componentdidmount settimeout const button document getelementbyid button const button this button console log button first click button click console log button second click button click 3000 delay const count num console log out count this setstate loading true settimeout const datum math random 10 console log in count this setstate datum datum loading false 1000 render const loading datum this state if loading return this be load return datum datum this button ref onclick this delay update demo2 js import react from react let num 0 export default class hello extend react component state loading false datum 0 componentdidmount settimeout const button document getelementbyid button const button this button console log button first click button click console log button second click button click 3000 delay const count num console log out count this setstate loading true settimeout const datum math random 10 console log in count this setstate datum datum loading false 1000 render const loading datum this state if loading return this be load return datum datum this button ref onclick this delay update the only different code be in componentdidmount the console message be aslo different about two demo demo1 result image demo2 result image
facebookreact
potential future bug in geteventkey for edge with synthetic event normalization
Question
bug current behavior react currently normalize keyboard event cross browser by fall back on the native keyboardevent keycode property and use a dictionary object to normalize the key as note in the source geteventkey be use for normalization of deprecate html5 key value edge currently do not implement the correct key value and this normalization will fall back to keyboardevent keycode keyboardevent keycode be deprecate and may be drop at any time microsoft as per have fix this issue but it have not yet be release to insider preview release this mean there be the potential for the keyboardevent keycode to be remove from edge before the fix be make public it may be a good idea to not rely on keycode in this instance refer to line 103 which version of react and which browser os be affect by this issue do this work in previous version of react react dom version 16 2 0 potentially affect future version of edge
facebookreact
react add classname to dom instead of class in ie11
Bug
do you want to request a feature or report a bug it be a bug what be the current behavior react add classname to the dom instead of class property 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 open the link below in ie11 and inspect the dom there will be the following h1 hello react link to the test repo what be the expect behavior to add class to dom when an element have property classname 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 1 internet explorer 11 version 11 540 15063 0 it work as expect in react 16 2 0
facebookreact
capture event trigger after vanilla bubble event
Question
do you want to request a feature or report a bug bug what be the current behavior when subscribe to dom event it s possible to use capturing however it seem that capturing take place after the vanilla javascript bubble phase this result in an incorrect order of event unless all event be subscribe to via react which isn t always possible here s an example that mimick one of our use case what be the expect behavior a capturing event subscribe to within react should take place before bubble event subscribe to via vanilla javascript which version of react and which browser os be affect by this issue development edition chrome v64 x64
facebookreact
don t synchronize property value with attribute especially for the value attribute
Duplicate
just read this repo
facebookreact
state change in td element
Question
display tabular row when set datum in td element on state change it display only the currently update td element datum all the other one go miss from screen when the same thing be place within text box in each td element thing work fine follow be sample the code work code fail code this state price i d
facebookreact
it s not safe to read currentowner current and assume it have a statenode
Bug
this l217 might mean that owner statenode be null so assumption like this lead to runtime failure in dev l1131 we should fix up all such code site
facebookreact
context update doesn t fully propagate in some case
Bug
I think there may be a bug in context in the late alpha when some update be schedule in the commit phase it doesn t seem to propagate git clone cd emoji search yarn yarn start enter mon erase it click on dark mode expect all child update actual some child don t update this only seem to happen with this indirection l12 l25 gif
facebookreact
context provider and maybe consumer show up as unknown in performance tab
Bug
notice this with 16 3 alpha I think we just need to support it here or else we could skip they here l162 altogether
facebookreact
child of consumer without new line give typeerror render be not a function
Enhancement
do you want to request a feature or report a bug bug what be the current behavior I get a confusing error when not use a new line in the child of a consumer un the new context api error selection 108 fix selection 109 what be the expect behavior component just get redere 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 1 and 16 3 0 alpha 0 chromium 63 archilinux react 16 2 didn t support the new context api