repository
stringclasses
156 values
issue title
stringlengths
1
1.01k
labels
stringclasses
8 values
body
stringlengths
1
270k
facebookreact
component that render non empty s can t re render
Duplicate
do you want to request a feature or report a bug bug from a react user s perspective why do this matter this matter in the context of server side rendering I want to have the structure render return where my page template contain then js disabled user will see the static one js enable user will see the dynamic one and everyone will be happy 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 open the js console then click the re render button in the fiddle what be the current behavior uncaught invariant violation unable to find element with i d 3 what be the expect behavior the button should update to re render 1 as it do when you remove set includenoscript false which version of react and which browser os be affect by this issue do this work in previous version of react I try 15 3 1 in chrome 52 linux I understand why it s happen so I don t think the browser or os be an issue the jsx for the fiddle seem not to work in firefox but I can reproduce the non minimal version of the problem there too I don t know much about how the rehydration process work but it seem like a reasonable solution might be to pass right over noscript s when rehydrate if js be enable they win t be visible anyway in chrome and firefox at least the noscript setting seem to be constant mod a refresh so we don t have to worry about change between render it seem to I like this might deserve a fix in trunk but I would also appreciate any workaround short of render a and output the whole page twice which I would really prefer not to do
facebookreact
native map detection in reactcomponenttreehook fail with core js
Bug
do you want to request a feature or report a bug bug what be the current behavior use polyfille es6 map on browser without native map support 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 isnative return true on ie9 what be the expect behavior use object instead of map while isnative method have be implement in 7491 it can t detect core js polyfill look at discussion in comment here diff 001d0647fb00f8336795faccdec19a31r11199 which version of react and which browser os be affect by this issue do this work in previous version of react 15 3 1
facebookreact
use react 15 under edge dangerouslysetinnerhtml doesn t work on any svg tag
Duplicate
hi everyone this issue be follow 6950 the fix work on ie11 unfortunately it doesn t under edge it seem that edge be implement innerhtml property on svg tag but in an inefficient way use it append svg text in the dom tree as it can be see use the inspector but edge doesn t render anything unless you modify the svg string in the inspector see the codepen update to use react 15 3 under edge to see that issue of course if we enforce edge to use the hack it work I don t know how to enforce it except browser sniff grr
facebookreact
input element setselectionrange after backspace do not work in ie10
Bug
do you want to request a feature or report a bug report a bug what be the current behavior 1 open this demo in ie10 2 type any five character text 3 caret should be at position 2 I e 12 345 because it be force there after every change with setselectionrange 4 use arrow or mouse to move caret to position 5 I e 12345 5 press backspace 6 caret go to position 4 I e 1234 what be the expect behavior caret should obey setselectionrange and go to position 2 even after backspace on ie10 which version of react and which browser os be affect by this issue do this work in previous version of react this bug start at react v15 0 0 react v14 8 do not have this problem this issue be report here heymdall find out that if you wrap setselectionrange in a settimeout 0 it set the position correctly though the user would have to type slowly to ensure this always happen so that be not a workaround
facebookreact
bug didputlistener try to finddomnode on unmounted component
Bug
I believe this be a bug and potentially related to but the specific detail be different enough that I want to file a separate issue feel free to close if it s the same root cause I have a repro here clickme be a component that run causeerror on click causeerror first render component of type a and b let s call they a0 and b0 b0 have a componentdidmount function that call setstate come into play later causeerror then update a0 with a new prop a componentdidupdate unmount b0 and mount a new b b1 after causeerror be all do react s runtime perform some op presumably due to b0 s setstate that lead to warn react can t find the root component node for datum reactid value 2 if you re see this message it probably mean that you ve load two copy of react on the page at this time only a single copy of react can be load at a time uncaught typeerror can not read property firstchild of undefined peek at the stacktrace it look like didputlistener be try to finddomnode on an already unmounted component some weird detail leave off onclick remove this error not call setstate in b componentdidmount also remove this error so it s a bit different from 3298 because it s not errore if we only unmount b during a click it s errore if we have onclick and setstate this be on react 0 14 I test it briefly on react 15 and get invariant violation react dom tree root should always have a node reference which presumably be a well form version of the same error
facebookreact
freeze class and defaultprop in dev mode
Enhancement
to make compiler optimization around class and inline defaultprop we need to know that they don t get mutate this escape analysis can be difficult to do in a js compiler so we should start enforce it so we don t have to rely on escape analysis js const type element type if typeof type function type wastaggedreactcomponent object defineproperty type wastaggedreactcomponent value true object defineproperty type defaultprop writable false configurable false object defineproperty type prototype render writable false configurable false object defineproperty type prototype componentdidupdate writable false configurable false object freeze type object freeze type defaultprop object freeze type prototype we can also make they getter setter so that we can make nice warning message for set although we should weigh this against slow down dev mode if a property exist it should preserve its enumerability if a property doesn t exist it be still ok to attach a getter setter as long as it be non enumerable
facebookreact
injectenvironment call twice react test renderer and react dom
Bug
try to test a very simple react component use material ui through jest and react test renderer I m stuck because reactcompositecomponent injectenvironment can only be call once it look like react test renderer call injectenvironment but so do react dom which be in my actual application import somewhere within a material ui module which be in turn import by my component code this may not really be a bug in react or react test renderer per se though one could imagine other dependency somehow load react dom as well cause the same issue I create a test case at which may provide some more context react 15 3 0 react dom 15 3 0 react test renderer 15 3 0
facebookreact
babel node reactcomponenttreedevtool js cause reactdomserver rendertostre to fail
Bug
while follow a server side react tutorial I encounter a runtime error cause by reactcomponenttreedevtool specifically the purgedeep function seem to be problematic under certain condition react lib reactcomponenttreedevtool js line 47 user code stack trace screen shoot 2016 07 24 at 3 41 00 pm offend code resolution add a check for undefined childid before the traversal react lib reactcomponenttreedevtool js line 47 resolve the issue see below screen shoot 2016 07 24 at 4 02 23 pm additional os os x yosemite 10 10 5 node 4 4 7 run on babel node via babel cli 6 11 4 let I know if there s any additional information I should provide e g dev dependency thank
facebookreact
make createelement undefined warn more descriptive
Enhancement
update claim by jin this be what I see when I mistype an import this be not very useful when type be undefined we should provide a well message in 95 of case it be cause by an invalid import we should create a page explain common case how this could happen e g mismatch default name export forget to export the component or import a non exist name export and link to that page from the warning
facebookreact
in nw js app the file type onchange event doesn t fire
Bug
I use react in my node webkit application I just update the react and react dom from 0 14 3 to 15 2 0 I haven t change my code but the onchange event not fire now and there be no error console log any help will be appreciate
facebookreact
checkbox attribute unnecessarily remove from dom on every render
Bug
do you want to request a feature or report a bug bug what be the current behavior render a list of control checkboxe cause the reconciler to unnecessarily update add or remove the check attribute on every render regardless of whether the value have change I have a table with 300 500 row that need to add a highlight class to the row base on some user interaction on another part of the screen I d expect that the table renderer would get call on every interaction but I be see 40ms render time in the perf tool I dig into it and it look like every render the reconciler remove the check attribute see jsfiddle the check attribute on the row datum never change be always false extract the row into their own component and use componentshouldupdate fix the slowness but this seem like 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 here be two jsfiddle demonstrate the issue minimal repro full repro what be the expect behavior the reconciler shouldn t be touch the dom for attribute that haven t change which version of react and which browser os be affect by this issue do this work in previous version of react mac osx 10 11 chrome 51 safari 9 1 firefox 44 react version 15 0 1
facebookreact
input onchange not trigger every time in ie11 if e preventdefault use
Bug
input onchange not trigger every time if e preventdefault be call in onchange handler occur when type fast some character be lose react 5 0 2 ie11
facebookreact
oninput be not fire on contenteditable div in ie11
Bug
when use oninput event on contenteditable div the event be not be fire on ie11 it do work on chrome 51 0 2704 103 64 bit and microsoft edge it also reproduce on react 0 14 so it doesn t seem to be a regression see it be reproduce here maybe relate to 4051 jquense
facebookreact
miss react element for debugid warning when test component with jest
Bug
do you want to request a feature or report a bug report a bug what be the current behavior when test component warn reactcomponenttreedevtool miss react element for debugid 1 when build stack be show when call testutil renderintodocument 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 npm install npm test what be the expect behavior accord to 7187 this be an internal warning and shouldn t be display which version of react and which browser os be affect by this issue do this work in previous version of react I didn t receive this warning on 15 2 0
facebookreact
onchange not fire properly in react 15 2 0 ie11 when paste text into textarea
Bug
hello on ie11 react 15 2 0 when copy paste datum from keyboard to a textarea onchange not fire this work fine in chrome and ff I ve include a test link a log msg should happen when you copy paste datum into textarea thank
facebookreact
bug miss react element for debugid trigger by reactdomserver rendertostaticmarkup
Duplicate
as of react v15 2 0 the provide fiddle be throw the missing react element for debugid warning which have be describe as an internal I e not user face react warn this warning be not present in react v15 1 0 I make no claim that this be a sane usage pattern only that it exist in real world component l157 and that it s an unexpected failure case
facebookreact
miss react element for debugid warning when trigger a render in componentwillmount
Bug
do you want to request a feature or report a bug bug what be the current behavior as report by adamryvola in issuecomment 230349514 react be display a warning warn reactcomponenttreedevtool miss react element for debugid 2 when build stack when another component be render in 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 js import react component from react import reactdom from react dom const container document getelementbyid container const menucontainer document getelementbyid menu container export default class app extend component componentwillmount reactdom render menucontainer trigger the warning render return app reactdom render container jsfiddle what be the expect behavior accord to gaearon this warning be against internal bug in react it s not mean for user source issuecomment 230272365 so this warning should not be trigger which version of react and which browser os be affect by this issue do this work in previous version of react react 15 2 0 no issue with react 0 14 7
facebookreact
get a warning use reactcsstransitiongroup in react v15 2 0
Bug
bug what be the current behavior when use reactcsstransitiongroup in react v15 2 0 it warn I about an unknown prop pass to the dom element create by this component span warn unknown prop transitionappeartimeout on tag remove this prop from the element for detail see in span create by reacttransitiongroup in reacttransitiongroup create by reactcsstransitiongroup in reactcsstransitiongroup create by element panel in element panel create by connect element panel in connect element panel create by diagrammer page in div create by diagrammer page in diagrammer page create by connect diagrammer page in connect diagrammer page create by constructor in constructor create by connect constructor in connect constructor create by diagram edit in diagram edit create by routercontext in div create by model layout in model layout create by routercontext in routercontext create by router in router create by app in provider create by app in app in appcontainer demo 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 react v 15 0 2 os test on osx el capitan it work on previous version
facebookreact
group warning for unknown dom property
Enhancement
I just run react bootstrap doc page on master and see a ton of warning from 6800 jun 30 2016 01 55 that page be really long so maybe it s an edge case but at the very least I think we should group prop from the same element into a single warning for example these warning could become one
facebookreact
deprecate call proptype validator in production
Enhancement
we want to strip the code that implement proptype validation function in production this doesn t mean react proptype win t exist just that the function will throw in production every time I do an initial attempt at this in 6401 but it s too much of a change because people might be call proptype in production right now for introspection and we d need to deprecate call they in production before actually turn they into shim that throw error spicyj suggest issuecomment 224386567 a good first step we should pass an extra argument to proptype checker we would warn if that argument be not pass or if pass do not match our secret value this way we can detect if somebody manually call proptype validator and warn with console error in production if you d like to work on this please comment here so we don t have many people implement this at the same time you would need to 1 pass an extra argument to prop type checker 2 in production warn inside the prop type checker if they don t receive the expect extra argument 3 the warning should say something like you be manually call react proptype validation function in a production build this be deprecate and will not work in the next major version 4 don t forget to write test you can peek at 6401 to see how to write test that simulate production environment 5 send a pr and we ll discuss furth
facebookreact
can not read property getnativenode of null reactreconciler
Bug
hello everyone I have a problem after update react from v0 14 8 to the current late v15 1 0 actually I can not even tell what exactly cause this problem on some page of my spa everything work just fine but during one specific action in my app this error happen this problem appear after react and some dependent library update screenshot from 2016 06 24 13 40 15
facebookreact
value of input range incorrectly round after mount step attribute ommite
Bug
do you want to request a feature or report a bug bug what be the current behavior react at the beginning round input type range value to 0 or 1 and then look at step parameter which be 0 1 for example the result be incorrect value of input after component mount when I put value attribute after step attribute it work fine 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 demo comment or uncomment line 13 and 14 to see the difference what be the expect behavior to always look at step parameter and then round the value if require which version of react and which browser os be affect by this issue do this work in previous version of react v15 1 0 opera chrome firefox yes work in v 0 14 0
facebookreact
can not access this or prop
Question
do you want to request a feature or report a bug seem like a bug not sure what be the current behavior unable to access prop if the function be define outside if the current behavior be a bug please provide the step to reproduce what be the expect behavior expect behavior be have access to the prop which version of react and which browser os be affect by this issue do this work in previous version of react I be work with 15 1 0 though I believe this be present in old version as well
facebookreact
reactperf throw production be not define error
Invalid
I m use webpack to build my react project react 0 14 6 and somehow it be throw production be not define referenceerror in reactperf because in my webpack setting I be inject the node env which be work fine before any advice on that screen shoot 2016 06 13 at 11 11 05 am screen shoot 2016 06 13 at 11 11 05 am
facebookreact
how to handle proptype undefine in production
Invalid
I be aware that note that for performance reason proptype be only check in development mode prop validation in development mode we have model collection of proptype e g js import proptype from react import layout from component layout export const schema direction layout proptype direction isrequire component proptype arrayof component layout be react component I be expect to access proptype direction property of layout component this work in development environment however because proptype be strip in production I be get an error uncaught in promise typeerror can not read property direction of undefined the only fix that I can think of in user land be add a safe check that eliminate the dead code during the build stage e g js export const schema dev direction layout proptype direction isrequire component proptype arrayof component null this be sub optimal because it would require update each instance where proptype be use to declare data shape be there an environment variable that would force to keep proptype but disable validation can you suggest an alternative approach to this issue
facebookreact
onchange randomly miss key on ie if type very quickly
Bug
I have a simple search bar control text input with autocomplete when I type text very quickly I do get onkeydown event but every now and then the correspond onchange event go miss for example if I type foobar the input field may end up show foobr this happen only on ie test with ie11 on window 7 and I have not see this on any other browser here s a fiddle show the issue and a log keydown f keydown o change f render f change fo render fo render fo keydown o keydown b change foo render foo change foob render foob keydown a render foob keydown r change foobr render foobr render foobr note that onkeydown handler see that a but not the onchange handler the fiddle include a timer which in real code trigger an ajax call which be somehow important for this issue if I remove the timer I can not reproduce this issue any more the react version in the fiddle be 15 1 0 but this happen on 0 14 3 too
facebookreact
onchange not fire when use keyboard
Bug
hello on firefox v31 and 40 at least when change value from keyboard onchange not fire actually it fire only on blur react 15 1 0 thank
facebookreact
documentation pass key to react createelement
Question
there be nothing in the documentation that indicate how to pass key s to react createelement also there be no explanation about prop child either especially when use react cloneelement should the prop child be copy or new child pass see also this so question
facebookreact
react addon perf doesn t work in ie11
null
I see error object doesn t support property or method table seem ie doesn t support console table
facebookreact
should react warn when control component have duplicate value
Enhancement
consider the following example live at with react 15 0 1 js const myselect prop banana broccoli orange tomato class app extend react component constructor super this state this onselectchange this onselectchange bind this onselectchange e this setstate selectedvalue e target value render return html itself doesn t seem to have any problem with duplicate value in the tag as you can see in the example above there be semantically valid reason you might want to do this but this control component example make it impossible to select e g orange or tomato the selection will be force to the first matching value I think about a solution that store both the selectedvalue and the selectedindex but react dom s do not take any sort of index prop so I d have to manipulate the internal dom node which I m sure be bad form react could be enhance to take a selectedindex but I foresee problem with single source of truth the fruit vegetable example be a bit contrive and there may not be many real world scenario you would want to do this in my gut feeling be this should be a warning so developer like I don t paint themselves into a corner try to support this case
facebookreact
bug problem of use react addon perf
Bug
when try to use in google chrome it be find that after perf start error message display warn there be an internal error in the react performance measurement code do not expect ctor timer to start while componentdidmount timer be still in progress for another instance warn there be an internal error in the react performance measurement code we do not expect componentdidmount timer to stop while no timer be still in progress for another instance please report this as a bug in react after I type perf stop and try to use getwaste this error message display reactperf js 239 uncaught typeerror can not read property updatecount of undefined
facebookreact
change event fire too many time when input chinese character in ie 9
Bug
like 3926 but in ie9
facebookreact
form disappear without call onsubmit
Question
do you want to request a feature or report a bug report a bug what be the current behavior when a form element disappear as the result of a state change e g trigger by an onclick handler on the submit button its onsubmit handler be not call in html even if a form element be remove from the dom its onsubmit handler be still call 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 plain js html version expect behavior reproduce in react the comment out settimeout in the react code be a usable hack to fix it for the time be what be the expect behavior the code specify in the form s onsubmit should be execute before the form disappear which version of react and which browser os be affect by this issue do this work in previous version of react react 15 0 2 chrome 51 0 2704 63 64 bit os x 10 11 5
facebookreact
provide an opt in way to easily manage this in event handler
null
there s no shortage of place in react where a dev will write something like onclick this setbookssubject or alternatively onclick this setbookssubject bind this it s not ideal to re create these function on each render so the alternative would be some form of auto bind in the class s constructor all of which re create these function once per instance and require boilerplate I d love to see the react team add some way of opt in to have a handler call ed with the current component set as this by current component I mean the component whose render create the element I don t know what it should be call but for example if it be call ownclick it would look like this click I and so when that button be click foo would be call with the object that own the render method which render the button set as this
facebookreact
perf printwaste doesn t work when component conditionally return null
Duplicate
after upgrade to react 15 0 1 or 15 1 0 I m not able to use printwaste from perf tool react 15 0 1 throw error reactdefaultperfanalysis js 177 uncaught typeerror can not read property foreach of undefined react 15 1 0 warning js 44 warning there be an internal error in the react performance measurement code we do not expect componentdidmount timer to stop while no timer be still in progress for another instance please report this as a bug in react I discover that error be connect with return null a lot of my component have something like that render function if this prop visible return null and when I try to measure one of those component I will get above error remove condition from component fix problem
facebookreact
fix issue introduce by createelement warning
Bug
this build on top of 6268 I fix a few style nit and indirection in it and later I realize it introduce a bug in cloneelement as I be trace this bug I find that it already exist in createelement in 15 x 6879 so I fix the bug for both case add more test and shuffle they around to sit in the correspond file react fix incorrect coercion of ref or key that be undefined in development gaearon in 6880 react fix a false positive when pass other element s prop to cloneelement ericmatthy in 6268
facebookreact
react createelement type key undefined be handle incorrectly
Bug
I believe 5744 introduce a behavioral difference between development and production version of react we release it as a part of 15 0 and this difference still exist the production behavior hasn t change however the development behavior diverge after this change js var el react createelement div key undefined document body innerhtml typeof el key el key what do you expect to appear 0 14 x development object null production object null 15 x development string undefined production object null the 15 x dev behavior be different because dev code path only check the existence of a property but not whether it s undefined l130 l133 whereas the prod code path check for undefined explicitly l135 l136 react cloneelement be not affect because it doesn t include those warning this doesn t seem like a major problem nobody notice it in the real world but I think we should fix this I have a related fix in the work so I ll add some more test and include it
facebookreact
perf print method not work in 15 1 0 can not read property foreach of undefined
Bug
after upgrade to 15 1 0 I m have trouble use the react perf tool I ve do the follow add to one of my file import perf from react addon perf window perf perf I then launch my app in chrome open the dev tool and run this in the console perf start perf stop perf printwaste and I get typeerror can not read property foreach of undefined getwaste 7 7 js 149515 printwaste 7 7 js 149666 anonymous function vm508 1 the failure be on this line flushhistory foreach function flush the same behaviour occur for all other print method such as printinclusive and printexclusive the same behaviour occur if I put the command into my code ie not run in the chrome console
facebookreact
react devtool 15 1 0 ctor timer error
Bug
bug warning display in console about internal error of react performance measurement code js import react from react import render from react dom import perf from react addon perf import browserhistory router from react router import route from route import persist from altflux persist persist doc const target document getelementbyid app perf start render target perf stop perf printwaste screen shoot 2016 05 23 at 9 21 08 am 15 1 0 google chrome
facebookreact
15 0 2 current starter kit example basic commonj not work
Bug
do you want to request a feature or report a bug bug what be the current behavior run npm install and then npm start in the example basic commonj directory of react 15 0 2 as find on result in the follow error syntaxerror user robert download react 15 0 2 example basic commonj index js unexpected token 13 11 while parse file user robert download react 15 0 2 example basic commonj index js 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 curl react 15 0 2 zip unzip react 15 0 2 zip cd react 15 0 2 example basic commonj npm install npm start what be the expect behavior the example work which version of react and which browser os be affect by this issue do this work in previous version of react react 15 0 2 npm 2 15 1 node 4 4 4 os x 10 11 4 unknown if it work previously
facebookreact
warning be change a uncontrolled input of type radio to be control
Bug
I have this code and when I click on radio it give I warn warn test be change a uncontrolled input of type radio to be control input element should not switch from uncontrolled to control or vice versa decide between use a control or uncontrolled input element for the lifetime of the component more info so its not clear why or be it a bug
facebookreact
how to force react to reorder key child instead of destroy recreate
Question
I m use react to build an application for view multiple webcast at one time I have a videogrid component that have an arbitrary number of videocell component as child each videocell have a unique key as describe here dynamic child I m try to implement the ability to swap the position of webcast on the screen it s important that the dom node be reorder and not recreate in order to prevent the webcast embed from reload base on the documentation dynamic child the component should be reorder not destroy and recreate because they have unique key when react reconcile the key child it will ensure that any child with key will be reorder instead of clobber or destroy instead of reuse the problem there be the or destroy it s vital that my component be reorder and not destroy I don t know how the diffing algorithm decide which component to reorder and which to destroy and recreate but I m see a mix of the two behavior that doesn t do what I want I create a simple test case on jsfiddle to demonstrate the problem I m have click the button to swap the key assign to the first and last component note how the last component be correctly move to the first position but the remainder of the component include the one at index 1 and 2 who don t change at all be destroy and recreate you can see that by how the embed video reload be there a way to force react to reorder child instead of destroy and recreate they
facebookreact
how do I test the authentication flow in my app
Question
hi I have an app implement auth use react router redux sagas jwt tldr how do I approach test this authentication flow basically I be use react router s onenter method to check if the user be authenticate to allow access to it the function check this info from the app state when credential be submit an action be dispatch which be receive by the sagas which send an api request and then store the credential detail in the local storage which then get reduce in the app state
facebookreact
change how reactperf printwaste and reactperf printoperation work
Enhancement
6046 be a rewrite of reactperf that aim to provide the exist feature of reactperf in a more testable and future proof way however there be a few thing that be out of scope of 6046 but be important to fix later after it be ship today printoperation print information about the dom native event that supposedly happen later this information be use by printwaste in the following way if a component be render but no dom event on its child be emit during a batch the render be consider waste there be a few problem with this as discuss in we overemphasize the overhead of dom operation which be actually often negligible with incremental reconciliation 6170 the assumption that dom operation happen in the same batch as rendering might become incorrect we might want to get rid of rely on batch at all discussion r61482538 I don t know what would be a good solution consider these constraint people widely consider printwaste the most useful reactperf method because it help find shouldcomponentupdate sweet spot if we remove its reliance on dom we should offer an equivalent e g deeply compare react element that be just as useful but more friendly to incremental reconciliation
facebookreact
control number input doesn t handle e and properly
Bug
a control number input without a corresponding setstate function still allow e and to be enter and number can be inputte afterwards I could be incorrect but I don t believe this be the desire behavior here s a jsfiddle demonstrate the issue
facebookreact
I get react v15 update error
Question
I run this command npm install save screenshot from 2016 04 17 14 11 38
facebookreact
child don t re render when parent component be optimise
Question
I be see something that look like a bug and have write a simple test case for it please refer to this webpackbin as it contain the test scenario
facebookreact
testutil findallinrenderedtree be not iterate through all component since react 15
Bug
most of our test rely on this I go through a debugger and step through the callback function only the component foo and bar be capture any sub component under be not come in the callback var component reactdom render container testutil findallinrenderedtree component child console log child
facebookreact
react 15 break server render check sum
Duplicate
I m develop an universal app with react and after update to v15 0 1 I start get this error warning react attempt to reuse markup in a container but the checksum be invalid this generally mean that you be use server rendering and the markup generate on the server be not what the client be expect react inject new markup to compensate which work but you have lose many of the benefit of server rendering instead figure out why the markup be generate be different on the client or server client ut class md input name txtcadmus pat server ut class md input pattern 0 9 nam it seem to be some bug on v8 object assign reordering or something like that but I m not completely sure try to change a bunch of stuff e g force both server and client to use a polyfill or use babel transform object assign plugin but nothing solve the problem then I uninstalle react 15 0 1 and instal 0 14 8 again and the problem be go btw it s pretty simple to simulate the issue code javascript reactdom render document queryselector main console log document queryselector main innerhtml console log reactdomserver rendertostre react 15 not work 15 0 1 react 0 14 8 working as expect 0 14 8
facebookreact
type in middle of control text field jump to end
Bug
repro go to scroll to todo example type anything into the input field click in the middle of the text and type another character notice the cursor jump to the end of the text field
facebookreact
warn when change the type and value of an input field
Bug
in my render method I have something like if I first render this input as a number e g dynamictypevalue number dynamicvalue 5 but then change the input to a string dynamictypevalue string dynamicvalue 01 01 2016 I get a warning that the new value be not a valid number the specify value 01 01 2000 be not a valid number the value must match to the follow regular expression d d d d ee d dompropertyoperation js 142 the specify value 01 01 2012 be not a valid number the value must match to the follow regular expression d d d d ee d screen shoot 2016 04 07 at 6 07 45 pm be this expect behavior
facebookreact
setstate in componentwillmount cause typeerror when render with rendertostre and precede by a component that render with rendertostre
Bug
call setstate in componentwillmount of a component cause the error typeerror can not read property currentelement of null at reactcompositecomponentmixin updaterenderedcomponent when render server side with reactdomserver rendertostre and precede by a component that render content use reactdomserver rendertostre or reactdomserver rendertostaticmarkup cause typeerror with 0 14 8 and 15 0 0 rc 2 work with 0 13
facebookreact
callback in setstate second parameter can not get mouse click s event handler
Question
hi all I use setstate in a click function and I pass a callback function to second parameter please look at in the callback function I can not get event handler be it reasonable I try to pass event handler into callback like but the state be wrong how can I get event handler and right state in setstate callback function correctly thank for your help in advance
facebookreact
transitiongroup
Question
var reacttransitiongroup react addon transitiongroup var content react createclass componentwillappear function console log componentwillappear componentdidappear function console log componentdidappear componentwillenter function console log mybox componentwillenter componentdidenter function console log mybox componentdidenter componentwillleave function console log mybox componentwillleave componentdidleave function console log mybox componentdidleave render function return content var todolist react createclass getinitialstate function return show false show function this setstate show true hide function this setstate show false render function var item this state show return show hide item could you tell I where the problem be
facebookreact
dead code eliminate react proptype checker in production
Enhancement
I be look if we can shave off some kilobyte here and there and notice that we ship proptype code that we never actually run in production I try replace it with a noop function with identical api and it seem to save 933 byte off the gzippe react min js and 1035 byte off the gzippe react with addon min js raw gz compare to last run build react dom server js build react dom server min js build react dom js build react dom min js 792 130 build react with addon js 3693 1035 build react with addon min js 792 138 build react js 3693 933 build react min js the dev build grow large though as we branch on dev now as far as I can see this would only break tool that rely on introspection of proptype in the prod build but I don t think if we ever support this usage scenario anyway be there any other reason that I miss why this might be a bad idea
facebookreact
deprecate return value of reactdom render
Enhancement
this be a tracking issue because we re not ready to deprecate the return value of reactdom render yet this will likely be a long term objective not immediate but we should have an issue to reference as we start to get the ball roll reasoning we be work towards a new incremental reconciler which mean that a render may not be complete prior to reactdom render return for anyone rely on the return value of reactdom render there would be a race condition where the return instance be potentially not fully mount safe look code might work 99 of the time but fail 1 of the time at the sole discretion of the scheduler to be clear this be not an issue today but will become an issue once we start utilize an incremental renderer iff people rely on the return value as we prepare for the new reconciliation algorithm we should start encourage people should start avoid the return value of reactdom render people should instead attach a callback ref to their root component when render the component thus allow they to get a reference to the instance after mount be complete first step in this process be to update the documentation to state that the return value of reactdom render be legacy and that people should attach a ref instead similar to what we do for string ref
facebookreact
support question serverside render only why re render on client
Question
alright kind of a react newb but react be not follow the principle of least surprise with this one so I have to ask our team only really want serverside render for a particular project we don t need to do much special on the client however as far as I have learn you need to have a reference to the same react component on the client as you do on the server in order to actually get dynamic behavior event be bind etc on the client my question be if we have a why isn t react setup so that on the front end we could just call js reactdom render document getelementbyid react root without the react component first argument doesn t couldn t react have enough info to go off of already so as to not need an actual reference to the react component on the front end as well as long as react on the front end have a reference to the root dom node couldn t shouldn t that be enough the whole thing where you have to re render on the client be kinda unexpected I be sure I be miss something or there must be some good reason why the lib work this way I just don t know and want to know which be why I be write this thank
facebookreact
testutil renderintodocument and lifecycle
Question
hi everybody there something I don t understand in the testutil library I want to test a react component with testutil the lifecycle of my component be getinitialstate componentwillmount render componentdidmount componentwillreceiveprop shouldcomponentupdate componentwillupdate render componentdidupdate componentwillunmount if I use testutil renderintodocument these method will never be call componentwillreceiveprop shouldcomponentupdate componentwillupdate componentdidupdate because a new container be recreate to each call to renderintodocument renderintodocument function areactelement var div document createelement div return reactdom render areactelement div see my fiddle so I don t understand why you suggest to use renderintodocument method to test react component I think its well to use method like create the container let container document createelement div call render method let component reactdom render reactelement container to test react component see fiddle your opinion good regard
facebookreact
uncaught invariant violation must be mount to trap event when replace an image with a link to an image
Bug
I m have a hard time narrow a repro down for this and there seem to be a lot of require move part so I ll try to give as much information as I can relevant snippet of package json react 15 0 0 rc 2 repro w 0 14 7 as well react dom 15 0 0 rc 2 react redux 4 0 6 react router 2 0 0 rc5 react router redux 4 0 0 rc 1 redux 3 2 1 our route look something like this layoutnofooter simply wrap layout and pass an additional prop in I have this component in the header which be render by layout header be a react redux connect component page1 have a componentwillunmount that dispatch an action that ultimately toggle searchmode in headerlogo when I go from page1 to page2 the invariant violation fire if I settimeout the action dispatch in componentwillunmount it appear to work fine if I replace layoutnofooter with layout it appear to work fine the invariant violation be on the img tag of the headerlogo stack I ve try build a repro in codepen with a similar structure setstate call to simulate react router and redux but I suspect they be do more that would require I to actually build a repro w those technology if that would be helpful I can work on it over time and hopefully repro it maybe there s enough info here however thank
facebookreact
input type email as control component do not control white space
Bug
a control input file of type email behave differently from a control field of type text if you manage a control input field of type email the actual state and the render dom be different if the user digit space e g with an input element like this if you try to digit letter or space you will always get render the string stringfromthestate with an input element like this if you try to digit letter you will always get render the string stringfromthestate if you try to digit space you will get a new render string that compose the state with the space this be problematic be before save the state you need to validate the field and force it to do something smart like strip the white space
facebookreact
make respondereventplugin cross platform
Enhancement
dieppe work on make respondereventplugin work with dom in 4303 but this be put on hold after 6338 bring all the relevant file into react repo we can start think about it again I m create this issue to keep track of whether we want this to happen or not and what be our plan regard this if there be a consensus we can look into rebase 4303 cc sebmarkbage jordwalke
facebookreact
warn when use overlap style e g border and borderbottom
Bug
this good first bug be take by yongpilmoon don t work on it unless that s you this have be discuss a few time before but I don t think there be any conclusion and prs intend to solve the issue be not merge for various reason I would like to close those prs as outdate and reboot the discussion about this performance consider the conclusion from sebmarkbage and syranide seem to be we should consider not allow conflicting style rule at all issuecomment 57338177 imho all thing consider it s well to just disallow overlapping and warn in dev issuecomment 132996649 radium by ianobermiller come to the same conclusion in but there be some backlash afterwards react native seem to allow style expansion but only for a few attribute e g margin and padding but not border I m close old pull request about this and create this issue to track implementation of the behavior we seem to agree upon we should warn in dev when border and borderbottom be use at the same time we can discuss more specific should either be ignore should we allow a few whitelisted property but warn for other in this issue as a migration strategy we can suggest people to use something like if they really need those shortcut it s also something we ll need to decide upon when implement integrate styling relate issue 2231 2407 5030 relate prs 2013 4661
facebookreact
nest property issue
Question
hello I have the code javascript class component extend react component render this prop nest prop this prop parse nest prop return component componentdidmount console log this prop nest prop component defaultprop nest prop default const obj1 nest prop obj1 const obj2 nest prop obj2 class application extend react component render return react render document getelementbyid app console output obj2 obj2 why do I get 1 variable reference for 2 separate component instead of 2 instanse of nest prop for every component why this prop save only last setted value for all instanse of the component after mount be it a normal behavior I think the correct behavior be have different property value for different instanse p s I test this code here
facebookreact
firefox issue expect flush transaction s store dirty component length to match dirty component array length
Bug
I be able to come up with a repro for this bug that do not rely on weird interaction between js and flash though it only happen in firefox a summary of the repro be that if you have a react component that be update itself via a setinterval loop and an input that be focus and you zoom in out to trigger a resize handler which re render the react component the error be trigger note that this only happen in firefox and if the input be focus this do not seem to happen in chrome the same workaround suggest in 4958 also apply I e wrap the resize handler body in a settimeout
facebookreact
disabled input button should not fire onclick in ie11
Bug
the follow button should not fire onclick but it do so in ie11 chrome and mozilla be ok use the normal dom without react be ok too see the plunker example that reproduce the issue open it with ie
facebookreact
reactperf printdom throw uncaught typeerror convert circular structure to json
Bug
identical app I call printdom after the app be load react 0 14 7 react 15 0 rc1 rc2 and master we should fix this before release 15 0
facebookreact
how to use life cycle hook for animation use react low level api
Question
I need to work around a bit of animation in react for that I be use the low level api of react I e react transition group this I want to use because it provide I the life cycle hook like componentwillenter callback componentwillleave callback but I be strike in the problem how to use those life cycle hook herre be mine code export default class app extend component componentwillleave callback console log component be leave componentwillenter callback console log component be enter render const style require app scss return this prop child but the life cycle hook function componentwillenter and componentwillleave be not get call please let I know what mistake I be make
facebookreact
v15 rc1 seem to skip some text node in ie
Bug
the follow var hello react createclass render function return hellot result in only hello be write in ie11 jsfiddle I realize there have be some change to the way text node work in v15 but before we update our code to use I want to check if this be the intend behavior since test be write in chrome
facebookreact
select option empty value regression in 15 0 0 rc 1
Bug
react 0 14 7 empty emit empty string on change react 15 0 0 rc 1 empty emit string with value empty on change this be because react 15 0 0 rc 1 cut off value from option tag
facebookreact
rendertostre fail to terminate comment node
Bug
run this js let html rendertostre foo get this foo not sure if this be a bug but I think data reactid and friend be go in v15 no also when test v15 with an old project use v0 14 7 which have a much complex scenario rendertostre return follow cause a blank page
facebookreact
pre binding be problematic bind cause performance issue
Question
per this article I post this in stackoverflow I feel like I m in a catch 22 if I use bind on event handler or the pattern there could be performance issue with re render if I use the method describe in the article above then I can t pass argument to a single dry function I have to create several function to handle different scenario as in one of the answer in the so post with setemail setpassword what s the solution here
facebookreact
title tab value render use react
Question
hello react be their a way to show render element s value in title like we have var title span my title span div title title my value div output should be like this div title my title my value div
facebookreact
be there any way to update react child component
Question
parent element class reactwizard extend component constructor prop super prop this state childitem step 0 styleclass null category null datum this divstyle this divstyle bind this this changestep this changestep bind this componentwillmount var wizarditem this setstate childitem wizarditem render if this state childitem length 0 childitem this state childitem map value index return value var currentstep this state step return childitem currentbutton prev currentbutton next child component class reactwizarditemcenter extend component constructor prop super prop componentwillreceiveprop nextprop console log nextprops console log prop update componentwillupdate console log run if state change render console log render return subcategory select reactwizarditem center reactwizarditemcenter child element not show anything on componetwillrecieveprop and componentdidupdate this code work well when I change code return currentbutton prev currentbutton next I like to use first one this code be to make a wizard like content thank in advance
facebookreact
componen render but not call lifecycle function
Question
I have a project that create a html layout base on json file on the 4th and 3th step some component be not call lifecycle function for example component code component code basenode that be empty class rendering result render result console output console output mini project with reproducible error project
facebookreact
disable viewportmetric unless mouseevent lack support for pagex pagey
Enhancement
this rebase 2271 by syranide which fix 1300 the only change in the rebase be that the file move I haven t change the logic spicyj clean up the callsite internally so this should be good
facebookreact
cloneelement vs createelement
Question
can anyone let I know if use cloneelement on exist element instance or createelement on react element class which one be well in term of performance sometimes clone something be fast than create new instance please let I know thank
facebookreact
how I can test a swipe with testutil
Question
anyone of you know how I can simulate a swipe use testutil event simulation
facebookreact
framework
Question
do facebook recommend a good backend to go with react maybe something that already have login page feature build in
facebookreact
reactjs setstate bug my fault
Question
hello guy I make an exemple here to see exactly what I m talk about I use context for the storeinput function because in my app it pass through more than one component sorry for the short message but I don t have the good write english skill and it s more easy for I to show you if you don t understand something please let I know thank
facebookreact
why this prop child can not re render
Question
for example js class parent extend react component componentdidmount settimeout this forceupdate 1000 render return this prop child class child extend react component render return this prop random class app extend react component render return
facebookreact
add reactinstrumentation
Enhancement
summary this add reactinstrumentation for the isomorphic package that use the same approach as reactdominstrumentation currently it be gate behind dev but we will likely change this later to a runtime flag determine by whether there be any active listener the first few event we add here should be sufficient for react devtool as determine by the hook emit call in these event will also be useful for reconstruct the parent tree in the reactperf rewrite in 6046 test plan add this code to reactdebugtool js js reactdebugtool adddevtool onmountrootcomponent I console log onmountrootcomponent I onmountcomponent I console log onmountcomponent I onupdatecomponent I console log onupdatecomponent I onunmountcomponent I console log onunmountcomponent I run a react app and see that all call be correctly reflect in the console reviewer sebmarkbage jimfb
facebookreact
dynamic proptype
Question
hi I be try to construct a mixin which take a dev define component specification and construct its prop type default accordingly I be try to do something like this var generateproptype function customdata do the process here var mymixin proptype generateproptype this getcustomdata getcustomdata function return this customdata the above code do not work be there anyway I can do something similar many thank
facebookreact
performance for unmounte mount a component vs hide it
Question
be there a preferred method or performance benefit to hide a node in the dom via css vs mount and unmounte it for example I have a render function with the follow code javascript const map this context let selectedfeature let content infer the select feature from the info window if map infowindow map infowindow getselectedfeature selectedfeature map infowindow getselectedfeature if selectedfeature undefined content else content return content and I be wonder be this be prefer over something like this javascript return the first snippet mount and unmount the node and I feel this be clean in the analysis component since I know selectedfeature will always be define and I don t need any conditional code in this snippet or the analysis component but this can change very frequently in the application so I be wonder if one method be prefer or more performant over the other if performance be the same I will probably go with the first snippet as it feel clean to I and I m guarantee to have a value for selectedfeature
facebookreact
reactdom not define in react 0 14 7
Question
react render work fine but not reactdom render name class1webpack version 1 0 0 description main index js script test echo error no test specify exit 1 build webpack dev webpack dev server devtool eval progress color hot content base build author eason license isc dependency babel core 6 5 2 babel loader 6 2 2 react 0 14 7 webpack 1 12 13 webpack dev server 1 14 1 devdependencie babel preset es2015 6 5 0 babel preset react 6 5 0
facebookreact
programmatically access warning error after render
Question
let s say I have a component which have proptype static proptype iserror react proptype bool isrequire I want to ensure that this contract be not break so I have a test it should require an iserror prop expect function let result renderreactcomponent to throw error unfortunately it doesn t throw an error it do display a warning statement I d like that warning statement to be available thus I should be able to alter my test to this it should require an iserror prop let result renderreactcomponent expect result to have property warning thus ensure the contract be maintain
facebookreact
follow npm get start guide incomplete and result in error
Question
I decide to try out react today and begin follow the getting start guide for use react from npm use react from npm unfortunately I be unable to get the example up and run the first problem I encounter be the miss html file which I scavenge from low in the page and adapt however once I load up the bundle js file in the html page I receive the follow error in the browser console uncaught invariant violation registercomponent target container be not a dom element be there a step I miss somewhere
facebookreact
add new reactperf
Enhancement
this be a work in progress on implement new reactperf as discuss in 6015 per sebmarkbage s request I decide to focus on remove dependency on internal method name datum will be explicitly pass to the perf tool from react method and we will attempt to not rely on the execution order rather than refactor the exist code I choose to create a new tool side by side so I can compare their output until I m confident about correctness I will later add profile feature gate to the call x add barebone implementation of new reactperf x it should count totaltime for flush x it should not count totaltime twice for nest flush fix a minor bug in reactperf x it should not rely on the rendering and mount stack match parent hierarchy x decide how inclusive measurement work x add a safety mechanism to avoid accidentally forget endmeasure x it should count exclusive time for every lifecycle method x it should include displayname and other component information x it should reconstruct the parent tree x it should count count and create for component x it should count exclusive time for component x it should count inclusive time for component base on parent tree x make it the debugtool x make sure team that replace reactdefaultperf with wtf can keep do so x it should implement printdom x it should implement printwaste x treat stateless component correctly x expose the new reactperf as react addon perf x make sure wasted measurement be useful something s off right now do we want to rely on owner test remove the old reactperf code introduce the new profile gate and put call behind it x consider the implication of use weakmap in profile build expose react unstable instrumentation x make sure we have new get method and deprecate printdom and getmeasurementsummarymap be still there expose whatever react native need for systrace integration and enable profile verify compatibility with react art e g add stuff like this l87 l89 ensure we throw a meaningful error when start be call inside the lifecycle or well consider provide support for that see also 2095 3436 new reactperf be correct test have no effect in production be hard to break accidentally when refactore and do not rely on implementation detail
facebookreact
async route cause server side checksum invalid error
Question
note this may be an issue for react router instead if so please inform I and I will notify they I m use webpack react router and react I get this error while use react router with async route and server side render shell bundle js 1 warning react attempt to reuse markup in a container but the checksum be invalid this generally mean that you be use server rendering and the markup generate on the server be not what the client be expect react inject new markup to compensate which work but you have lose many of the benefit of server rendering instead figure out why the markup be generate be different on the client or server client
facebookreact
use mixed array with string have warn
Question
js var hello react createclass render function return this prop name react render be work document body have warn each child in an array should have a unique key prop check the render method of hello see for more information jsfiddle
facebookreact
render during reconciliation cause npe
Bug
I have a view with a control select on it when the onchange event fire the result function actually change the view remove the select then I get this error uncaught typeerror can not set property pendingupdate of null reproduce here react 0 14 7 I also notice I don t get the same error in an old version 0 13 1 the line that throw be in reactdomselect l183 javascript function handlechange event var prop this currentelement prop wrapper state be not null here var returnvalue linkedvalueutil executeonchange prop event this wrapperstate pendingupdate true wrapperstate be null after the executeonchange happen reactupdate asap updateoptionsifpendingupdateandmounte this return returnvalue I be able to see a fix for a similar situation here I don t know if a similar check could be apply here or maybe I just shouldn t remove my select as a result of an onchange event
facebookreact
port reactperf to the new devtool api
Enhancement
there be a few concern that I hear about reactperf in the order of importance 1 it be gate by dev but react native want to have a way to enable it in production build and pass the accumulate info into systrace 2 it be often break by refactore 3 it appear generic but depend on specific module and method name 4 it have some obscure bug that be hard to fix because of the coupling 5 the console table visualization be poor 6 we be work on a new devtool api so they should align if I m mistaken here please let I know in 5306 we start introduce a new set of apis for first class instrumentation it make sense that we transition reactperf to the new api and fix some of these issue while we re at it I talk to some people on the react native about this what I understand so far be asap we want to remove reactperf function wrap completely address 2 somewhat mitigate overhead from fix 1 we want to create a devtool like reactdomdebugtool e g reactperftool address 6 unlike reactdomdebugtool reactperftool will not be gate by dev address 1 reactperftool will have startmeasurement and endmeasurement method for profiling function address 1 it can have more granular method for specific part of react lifecycle if need address 2 3 5 call to reactperftool will be gate by a runtime flag e g reactperftool isactive address 1 in the future rather than reach out into the profiled function startmeasurement will accept arbitrary argument address 3 we would separate generate user meaningful datum from its accumulation so it would be easy to test address 4 bonus we can use a noop decorator babel plugin to insert if reactperftool isactive reactperftool startmeasurement and endmeasurement call mitigate pain and potential breakage from address 1 bonus rather than console table api we can provide a component that interpret that datum and display it in an overlay both on web and native address 5 the decorator babel plugin part be the one I m not sure about because it would involve complicate tooling on the other hand it will allow add performance measurement to any function in the codebase without risk have early return s miss endmeasurement call and similar breakage during refactoring the first actionable step in my opinion would be to remove the function wrapping and the dev gate from the exist reactperf and replace measure with explicit startmeasurement and endmeasurement call gate by reactperf isactive wherever it be use we would still pass the function as an argument so we don t have to rewrite everything at once but this would give the rn team more freedom and unlock future refactoring we can also combine this with introduce decorator babel transform if this be the way we want to go to avoid add manual startmeasurement and endmeasurement call all over the place do this make sense what have I miss
facebookreact
remove event listener use with bind in es6 syntax
Question
I m try to communicate with an iframe with the postmessage api but I have an issue with the eventlistener management in es6 it be state in the doc that with react every method be automatically bind to its component instance except when use es6 class syntax the problem be that this handler bind this this handler so when I m do with the event I can t remove the listener because I can t keep a reference to the handler I could try to encapsulate the function but the encapsulate function would also need a bind I could try to super the constructor too but I m not sure this be a good idea plus I don t know the args it need I m quite sure I m miss an important point here any help would be much appreciated export default class somecomponent extend component handleiframedata event some stuff in there that will need this to be set to the component s context to get prop for example componentdidmount window addeventlistener message this handleiframedata bind this false componentwillunmount win t work because this handleiframedata bind this this handleiframedata window removeeventlistener message this handleiframedata false render return thank anyway
facebookreact
console show error uncaught invariant violation
Question
I be make an app base on this boilerplate ref gist the app be build fine but my console show this error uncaught invariant violation element type be invalid expect a string for build in component or a class function for composite component but get undefined
facebookreact
how can I visit the official site that writing by other language default english
Question
visit the link get start it s english page how to read this page that write by other language
facebookreact
update not queue properly when use unstable rendersubtreeintocontainer
Bug
the cursor should not jump to the end of the text field when edit text it s unstable so it probably doesn t need to be fix before the v15 milestone but we should get it fix at some point cc jquense
facebookreact
componentdidmount be call before the visual be render
Question
I be try to get visual attribute width to be precise of a component once it s render and css be apply I ve be try with componentdidmount but width be still 0 I be not sure what I m do wrong output rendering component do mount the ribbon s width be 0 and after that if I click on my header s button to re route back to the same page I e trigger an update then the componentdidupdate be call with the proper width be I miss something or be this a bug thank you lot folk javascript import react component from react export default class ribbonheader extend component componentdidmount console log component do mount the ribbon s width be this ref ribbonsvg width animval value be 0 this paintinsvg shouldcomponentupdate console log should component update never call return true componentdidupdate not automatically call but if I generate a routing event it update console log component do update the ribbon s width be this ref ribbonsvg width animval value width be 1020px good this paintinsvg paintinsvg const refribbon this ref ribbonsvg dosomesvgmagicthatdependsonthewidth refribbon render console log render return edit add a timeout to componentdidmount do the job although this be probably not normal javascript componentdidmount settimeout this paintinsvg 100
facebookreact
be not define
Question
I have a class that be try to do a get request in the componentdidmount function however if I initially load a page with this component in it I get the follow error be not define I follow the example from xxx I just change it over to es6 perhaps I be use something improperly class nativeapp extend react component state banner loadbanner this serverrequ get api banner function re this setstate re bind this componentdidmount this loadbanner render return manually load banner why export default nativeapp
facebookreact
nest of component fail with late stable react typescript amd require js
Question
I currently have a working example of a project that use the late react typescript use tsx file together with the amd module loading system with require js and build run debugging in visual studio 2015 ce however if I now try to nest 2 react component into a parent react component I be get exception in require js when run the app the child react component be work fine individually so the problem really seem to come from the nesting itself if I run the same project use an old version of react 13 x and not use amd module then the app work fine also when nest the react component I ve make a test repository public here hellopenguin be the old project use react 13 x and not use amd hellopenguin react0 14 6 amd be the new project late react 0 14 6 and use amd if you remove line 41 and 42 in applicationview tsx you will see that the app run fine and the individual react component also work fine this must be something I m overlook but I can t seem to pin it down do anyone know what could be wrong here and how to fix this problem thank
facebookreact
react cloneelement handle undefined prop differently to react createelement
Bug
I m not sure if this be expect but it catch I out early without clone function mycomponent mycomponent defaultprop foo foo let element react createelement mycomponent foo undefined console log element prop foo foo with clone function mycomponent mycomponent defaultprop foo foo let element react createelement mycomponent element react cloneelement element foo undefined console log element prop foo undefined
facebookreact
question how to just update parentless component outside of it
Question
copy of stackoverflow question comment57616408 34941598 how should I properly update component if it doesn t have a parent I ve find two way to do it first method here I update component through change component s state var hello react createclass render function if this state return null return hello this state name var component reactdom render document getelementbyid container component setstate name world settimeout function component setstate name stackoverflow 1000 second method here I update component through reactdom render method var hello react createclass render function return hello this prop name reactdom render document getelementbyid container settimeout function reactdom render document getelementbyid container 1000 so which method be correct or maybe here be a third correct way I know that I should flux etc but I want to know the simple way in the simple example