repository stringclasses 156 values | issue title stringlengths 1 1.01k ⌀ | labels stringclasses 8 values | body stringlengths 1 270k ⌀ |
|---|---|---|---|
facebookreact | can I render every element with different render function | Question | I need some element only have html and do not need datum reactid but I don t except I should render two element with different function e g rendertostaticmarkup rendertostre and combine it because the element could be include by many element render split and combine could cause mistake when element be much more if I could set an attribute in compoment javascript class defaultlayout extend react component render return defaultlayout noneeddiffcompoment true export default defaultlayout or a new pure html compoment javascript class defaultlayout extend react purehtmlcomponent render return export default defaultlayout if I write as above the render function can auto swap render function to render element be there any graceful solution |
facebookreact | onclick change render | Question | hi I m new to react if I want to click the button from dom then change render class from commentbox to commenttext below how to do it use simple onclick function something like if btnclick reactdom render document getelementbyid content else reactdom render document getelementbyid content var commentbox react createclass render function return comment var commenttext react createclass render function return text |
facebookreact | render static html client side | Question | be there any way to get a string of plain html from a react component but on the client side my app have a design editor that let you click element and edit their style nothing new there but I m re make it from the ground up use react both for the app itself and for the template that should be edit inside an iframe and then render elsewhere attach click handler to every editable element conditionally eg if the view be be render inside an iframe for the editor would be a nightmare and I can t just use jquery be editable click like I use to because of the virtual dom take all that in account it seem that the only solution be render the would be edit view as plain html so I can use the be editable click approach inside my editor any insight or similar experience |
facebookreact | issue with reactcsstransitiongroup | Question | I m get this error uncaught invariant violation addcomponentasrefto only a reactowner can have ref you might be add a ref to a component that be not create inside a component s render method or you have multiple copy of react load detail after instal reactcsstransitiongroup and it seem that I have only one copy of react run I m use gulp and browserify to package the app |
facebookreact | tip documentation on access prop of the child | Question | e g be this something you should avoid do |
facebookreact | scryrendereddomcomponentswithtag throw error on ff 43 0 4 | Bug | if the name of the input field be prop this test fail anything else seem fine only in ff though fail form test should find button debug html 35 1 htmlformelement doesn t have a name property setter for prop reactdomcomponent mixin getpublicinstance base test index js 11797 12 findallinrenderedtreeinternal base test index js 143582 21 findallinrenderedtreeinternal base test index js 143595 23 reacttestutil findallinrenderedtree base test index js 143681 13 reacttestutil scryrendereddomcomponentswithtag base test index js 143729 1 base test index js 144114 33 debug html 38 11 here be a test case jsx import react dom component from react import reactdom from react dom import expect from expect import renderintodocument scryrenderedcomponentswithtype as withtype scryrendereddomcomponentswithtag as withtag from react addon test util function into node debug debug document createelement div document body appendchild debug return reactdom render node debug class app extend component render return hello describe form test function it should find button function var f into expect withtag f button 0 toexist |
facebookreact | enormous datum reactid | Question | I m develop a big gui application chrome developer tool be lag because of datum reactid s reach a hundred kilobyte in size here s a small example 0 1 011 0 1 01 0 0 0 11 1 011 1 011 01 0011 0 10 1 010 1 010 01 0010 1 010 01 0010 01 0010 001 00010 1 010 01 0010 01 0010 001 00010 01 0010 001 00010 001 00010 0001 000010 1 010 01 0010 01 0010 001 00010 01 0010 001 00010 001 00010 0001 000010 01 0010 001 00010 001 00010 0001 000010 001 00010 0001 000010 0001 000010 00001 0000010 11 1 011 1 011 01 0011 1 011 01 0011 01 0011 001 00011 1 011 01 0011 01 0011 001 00011 01 0011 001 00011 001 00011 0001 000011 1 011 01 0011 01 0011 001 00011 01 0011 001 00011 001 00011 0001 000011 01 0011 001 00011 001 00011 0001 000011 001 00011 0001 000011 0001 000011 00001 0000011 1 011 01 0011 01 0011 001 00011 01 0011 001 00011 001 00011 0001 000011 01 0011 001 00011 001 00011 0001 000011 001 00011 0001 000011 0001 000011 00001 0000011 01 0011 001 00011 001 00011 0001 000011 001 00011 0001 000011 0001 000011 00001 0000011 001 00011 0001 000011 0001 000011 00001 0000011 0001 000011 00001 0000011 00001 0000011 000001 00000011 0 0 1 01 001 00012 0 0 10 1 10 11 what do I do wrong how data reactid be compute roughly could you create a paragraph somewhere in the performance manual on this issue |
facebookreact | onwheel stop bubble be not happen | Question | my target I be have a div which scroll but on come to the top or the bottom after the scrolling the div the scroll start happen on the entire page itself which I don t want I think it s happen due to event propagation so I be try to stop in follow manner my implementation I be use extend component es6 way to create my component and I ve put onwheel event listener as return console log scroll I e stoppropagation it s console out scroll I fine but I be not able to stop propagate this event to the parent not sure why stoppropagation be not happen exactly or whether this issue be happen because of propagation I don t want to use library which use mixin so please don t suggest I this way |
facebookreact | componentdidmount be call before render be completly do | Question | hi as much as I understand react component lifecycle componentdidmount should fire after render be do but I just find out today that this be not the case and I m not sure if this be a bug or lack of understanding from my side if I call a function that return some jsx inside render it always run after componentdidmount so if I have this setup componentdidmount always finish before rendertable or rendermessage jsx export default class table extend react component componentdidmount render const content this prop valid this rendertable this rendermessage return content rendertable rendermessage be I miss something or be it some bug thank |
facebookreact | drag n drop element sort | Question | hello I need advice about drag n drop sort with react 1 start datum js one two three render dom html one two three 2 after manual sort with drag n drop datum js one two three render dom html three one two 3 change data datum js three one two react apply change from array to dom html two three one for this reason I have to refund dom element to his place container insertbefore item itemoldsible html three one two problem if I have deep nesting of component html one two react do full rerender and 1 be no long need insertbefore 2 if leave insertbefore it fall with an error because item and itemoldsible no long exist whether there be a normal way to dnd sort with react |
facebookreact | way to create pluggable decorate component | Question | how be it possible to make pluggable aop style component which transform prop and transmit it to child more precisely how to pass prop to child element in parent render method I want to use it like this javascript scalable js example of aop style decorate component import react from react const scalable child const scaleddata child prop datum map e e 1 example transformation child prop datum scaleddata child this be what I want scalable proptype child react proptype element isrequire javascript scalableplot js plug to transform datum pass to and render with transform data import react from react const scalableplot datum js plot js import react from react const plot datum paint plot use data plot proptype datum react proptype arrayof react proptype number however when I do this react render child element without data prop upd solution should have use react cloneelement react cloneelement |
facebookreact | difference between currenttarget and target of syntheticevent | Question | there be 2 property in syntheticevent currenttarget and target it be identical usage or what be the difference between they |
facebookreact | server and client render the same markup but react still indicate checksum invalid | Question | screenshot 2015 12 22 15 57 53 |
facebookreact | diff patch with markdown preview | Question | when I preview huge markdown file with change dangerouslysetinnerhtml be very slow can I use react to smart innerhtml I don t know how to do it thx |
facebookreact | how would one pass latex code into a component | Question | I have the fairly rare but give the internet by no mean unusual situation where I need to embed latex code that need to be interpret later by a mathjax or katex etc the follow code doesn t work due to jsx intepretation of the bit inside p 1 some point p 2 some other point distance p 2 p 1 ratio frac percentage 100 new point p 1 distance cdot ratio use es2015 tempate string also doesn t work because then the get interpret instead p 1 some point p 2 some other point distance p 2 p 1 ratio frac percentage 100 new point p 1 distance cdot ratio and of coure double escape all the work but become impossible to read or write p 1 some point p 2 some other point distance p 2 p 1 ratio frac percentage 100 new point p 1 distance cdot ratio so be there a jsx feature that turn off interpretation for an element something like this that treat the text inside the element as untouchable p 1 some point p 2 some other point distance p 2 p 1 ratio frac percentage 100 new point p 1 distance cdot ratio |
facebookreact | how to get the index of click element | Question | I have some list item and I want know which one be click by user so I set onclik on every item and I user event target to get the node click but I get this issue my item have child nod when user click the child inside the element event target be not the element I want how do I fix it my code js var react require react var reactdom require react dom var cc react createclass handleclick function e console log e target getattribute datum key render function var s border 1px solid ddd display block padding 10px var item this prop arr map function a I return this return item var app react createclass getinitialstate function return arr 1 2 3 render function return reactdom render document getelementbyid app when user click the inside e target getattribute datum key return null I do can fix it by add the datum key attribute to all of element s child like js var item this prop arr map function a I return this but I don t think it be a elegant way |
facebookreact | react js display all datum in the text field for particular select i d | Question | the follow be the react render it work successfully when I get the single input tag and error occur error parse error line 59 adjacent jsx element must be wrap in an enclosing tag at param object option option to pass to jstransform when render multiple input text field render function var currentid this state currentid var phpdata this state phpdata var select phpdata filter function item return item i d currentid dbdata this state phpdata return select i d dbdata map function d return d i d update select map function datafield return if I remove this comment it show the above error react render document getelementbyid table datum |
facebookreact | stateless component performance | Question | be stateless component optimize use react createelement so they be not re render if the prop have not change stateless function if so it would be nice to mention that in the doc because then there be a significant difference between the follow js somecomponent prop return prop hugelist map performant prop return notperformant prop return somecomponent hugelist prop friend and it may not seem evident to someone think that they re just function |
facebookreact | how to use server side rendering in react in expressjs app | Question | documentation doesn t have neither any example nor link to example I want to know how step by step to use react on a server in an expressjs application how component file should look how they be connect to template and layout how expressjs response render template should behave if I render react on server how to include react component in a template should component be compile in advance and many other question in particularly I have a dust js template that be render this way in a controller router get function req re next re render index title title page index foo foo I compile and concat my js asset in one app js file and include it in my template like this and now I want to know how to use react on a server how I need to change my current routine to compile render react and my template on a server for now when I use reactdomserver rendertostre and reactdomserver rendertostaticmarkup I get these error and I don t know what do it mean because react documentation doesn t have any error explanation error invariant violation rendertostaticmarkup you must pass a valid reactelement typeerror can not read property reactautobindmap of undefined |
facebookreact | optimize componentwillreceiveprop and shouldcomponentupdate | Question | react component lifecycle dictate that when new prop roll in componentwillreceiveprop get call where you can calculate the new state and set it without a second cycle afterwards shouldcomponentupdate get call and we can compare prop and state of last cycle with the next one however if state be a product of the prop it make more sense to check whether the prop have change before calculate the state so unnecessary calculation can be avoid this produce some ugly look code where componentwillreceiveprop first run the code that would otherwise be in shouldcomponentupdate and base on that result set a new state or terminate simplify example componentwillreceiveprop function nextprop if nextprop this prop return calculate new state this setstate shouldcomponentupdate function nextprop nextstate return this state nextstate be there a clean way of approach this where no resource be waste on unnecessary state calculation |
facebookreact | way to disable the getinitialstate warning in es6 | Enhancement | I really like the convenience of the getinitialstate api in es5 react so I decide to reimplement it in a simple wrapper around react component but I get an annoying warning be there a way to disable this warning since I m do it intentionally and provide my own functionality |
facebookreact | render a snap svg image | Question | hi I m new to react I m look use snap svg for render some svg image into some view however I m not quite sure how good to set this up I m use ec6 and the babel transpiler could you explain the good way to add snap svg so that it can render to a view please really look for good practise here rather than I do it completely the wrong way thank |
facebookreact | if it s isomorphic code why do you require different code on the server | Question | in the doc you have an example for server side code and an example for client side code I think isomorphic code be suppose to work on both automatically |
facebookreact | singleton react component | Question | hey guy so in this application I m write there s a component call help section it s basically a box that show some predefine text about the component the user s mess with I want to be able to tell my help section component which component to show help for as of now I m use flux with some action and a store this isn t too bad and work quite nicely however it s quite a large setup with 2 file define specifically for this cause there be also a number of other issue that I ve experience such as help section action dispatch because of other action which raise a can not dispatch in the middle of a dispatch error however if I could define help section as a singleton I could just import helpsection from helpsection and be do with it since I ll get the instance of help section all I have to do be expose a method on helpsection that set the property I want to change and call it I know it break react s unidirectional datum flow with a component change another component but maybe it s worth it sometimes the way I think about it it s sort of a combination of a store some action and a component into one object a lot of component will only get instantiate once at run time so maybe it ll be quite useful in some case I couldn t find any reference to this on the web other than in this jsfiddle which seem to work nicely it s a bit unclear imo be this a good way to do it I m quite a novice in javascript and react so I might be miss some obvious point hopefully not what do you think about this thank for read p s sorry for any ambiguousness english be not my native language smile |
facebookreact | disable a specific warning | Question | will explain the issue briefly instead of extend react component I have a class which get state from a getinitialstate function if exist export default class basecomponent extend react component constructor prop child super prop child this state this getinitialstate this getinitialstate when use it in a component look like this export default class somecomponent extend basecomponent getinitialstate return this trigger a warning by react warn getinitialstate be define on somecomponent a plain javascript class this be only support for class create use react createclass do you mean to define a state property instead so my question be be there a way to disable this warning from happen cheer |
facebookreact | do the change of the state always fire the function render | Question | here be the example use strict import react from react export var componenta react createclass componentwillmount this setstate applist this prop applist c this prop c componentwillreceiveprop newprop this setstate applist newprop applist c newprop c render return this state applist map function object I return this state c componentdidupdate console log this ref console log this refs input1 value I use it on page a var applist 12 4 5 6 7 var c 12 react render containera 0 settimeout function var applist 3 4 5 3 var d 20 react render containera 0 2000 but after the second update I find that the value of the input can t change accord to the state that I pass in the second time I also want to know if there be some ui operation happen during two call for the render be it possible that react can reserve those for user or just refresh the whole component accord the state |
facebookreact | issue with simulate click invoke a function that I be spy on | Question | I be have lot of trouble test out whether click on my render button element be invoke the onclick handler here be my code for the component to be test use strict library dependency const react require react const categoryclearbutton react createclass render return clear clearallselectedcategorie this prop handleclick module export categoryclearbutton here be my test case use jasmine use strict const react require react const reactdom require react dom const testutil require react addon test util const categoryclearbutton require categoryclearbutton jsx const action require action dashboardaction let element describe categoryclearbutton beforeeach element testutil renderintodocument it will call the clearallselectedcategorie method when click let renderedbutton testutil findrendereddomcomponentwithtag element button spyon element clearallselectedcategorie testutil simulate click renderedbutton expect element clearallselectedcategorie tohavebeencalle here be the error message I m get in my console phantomj 1 9 8 mac os x 0 0 0 categoryclearbutton will call the clearallselectedcategorie method when click fail typeerror undefined be not a funtion phantomj 1 9 8 mac os x 0 0 0 execute 70 of 70 1 fail 0 069 sec 0 101 sec I be pretty sure the issue here be with the simulate click event not fire because I can make this test pass by do the following which lead I to believe that the spy be do its job it will call the clearallselectedcategorie method when click let renderedbutton testutil findrendereddomcomponentwithtag element button spyon element clearallselectedcategorie element clearallselectedcategorie expect element clearallselectedcategorie tohavebeencalle can anybuddy give a newbie some guidance thank andrew |
facebookreact | testutil renderintodocument issue with ref | Question | I m quite unsure where this error be come from error invariant violation addcomponentasrefto only a reactowner can have ref you might be add a ref to a component that be not create inside a component s render method or you have multiple copy of react load detail at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 26176 node module react node modules fbjs lib invariant js 46 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 19543 node modules react lib reactowner js 68 0 at attachref var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 20361 node modules react lib reactref js 23 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 20380 node modules react lib reactref js 42 0 at attachref var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 20251 node modules react lib reactreconciler js 21 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 8011 node modules react lib callbackqueue js 66 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 20159 node modules react lib reactreconciletransaction js 81 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 23475 node modules react lib transaction js 203 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 23422 node modules react lib transaction js 150 0 at batchedmountcomponentintonode var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 18151 node modules react lib reactmount js 283 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 23409 node modules react lib transaction js 137 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 15712 node modules react lib reactdefaultbatchingstrategy js 62 0 at batchedupdate var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 21476 node modules react lib reactupdate js 95 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 18345 node modules react lib reactmount js 477 0 at reactmount rendernewrootcomponent var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 19637 node modules react lib reactperf js 67 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 18419 node modules react lib reactmount js 551 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 18439 node modules react lib reactmount js 571 0 at react render var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 19637 node modules react lib reactperf js 67 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 20723 node modules react lib reacttestutil js 77 0 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 33989 user jankarlorodriguez rivera project web ux user portal test spec ui dollar input coffee 11 16 at var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 33991 user jankarlorodriguez rivera project web ux user portal test spec ui dollar input coffee 6 31 at newrequire var folder br b9kks4y50qvfl 1cr22jj1 c0000gn t 7fc1a283a49574bce1059aa1c5f740be browserify 75 user jankarlorodriguez rivera project web ux node modules proxyquireify lib prelude js 75 0 at user jankarlorodriguez rivera project web ux user portal test spec ui dollar input coffee 1 I m use coffeescript because the other test be write in coffeescript but 1 I try it with jsx and the same error and 2 it should matter anyways do here s my component and it have a ref jsx react createclass displayname dollarinput render function return and here s my test use jasmine karma and phantomj coffee testutil require react addon test util dollarinput react createfactory require user portal src script ui dollar input describe react dollar input dollarinput testutil renderintodocument dollarinput any idea where that error come from some trouble shoot it say maybe I may have two instance of react be load well I m use bower and add the proper file in my karma configuration js file bower component react react js bower component react react dom js test coffee I don t believe require react addon test util include another version of react and I would not imagine karma be load react more than once either I don t believe I m add a ref outside the component s render function either but when I remove the ref then I do not get this error but the component will not work properly jsx react createclass displayname dollarinput render function return |
facebookreact | componentdidupdate fire before reference be trigger or associate | Question | so I feel like componentdidupdate and reference be execute in the wrong order background I m work on a situation where you re in a list of input field with a blank row of field at the bottom when you press enter in any field it move your focus to the next one by talk to a register which keep track of all the field and their position shift enter go in reverse as well if you press enter on the final field it kick off a flux like action which result in the next blank field be render and then I want to move focus to that row so I set up a callback that will fire on the next componentdidupdate know that when that happen I ll have access to the new field which register itself during componentwillmount that work just fine I can access that component just fine however if I want to use a method to direct focus to a dom element within it it will be too early to make use of reference js const fieldcomponent react createclass receivefocus function reactdom finddomnode this refs input focus error this ref input undefined render function return react dom div react dom label some label react dom input ref input type text because the reference have not yet be bind even though we re at the componentdidmount update stage of the lifecycle so this js receivefocus function console log object key this ref log settimeout function console log object key this ref log input 0 seem to indicate that reference binding happen synchronously after now I could easily get around this by use reactdom finddomnode this and then use queryselector to find my target but that isn t a clean react way to go about solve the issue I believe base on what I know of the api that reference should be bind execute before componentdidupdate mount fire do this not occur by design mistake or incompatibility with other goal |
facebookreact | adapt doc to react rb | Question | I apologize if this be not the good place to ask this but we be get ready to document our ruby react js adapter react rb and would like to take the current react js docs as the starting point and change the example etc to use the ruby dsl syntax I believe that this be within the docs creative common license correct |
facebookreact | input element can not focus and can not edit | Question | hi guy I get a problem I write a react component when I render the virtual selector to body in bootstrap modal but I can not edit input or focus online example |
facebookreact | react dom and apple tv | Question | I ve be play lately with get react to work for build client server app for the new apple tv so I m open this thread just to start the conversation around the issue in case other people be also look into it for those unfamiliar with the subject the sdk for the new apple tv let you build javascript application that get load from your server and evaluate in a js context on the device now for building interface they come up with a dom implementation and some flavour of xml call tvml that just bridge to native ui component and apis much like react native in a way they also have a small javascript api call tvjs for create document make http call etc this way of building app be an alternative to the traditional ios development that you can also do on the apple tv with swift obj c uikit and the other framework the interesting thing be that the default apple tv app like music tv show etc be build as js client server app with browserify and handlebar template so at a first try react kind of work on the platform you might need to shim window and document as they be not available but as you start get into the detail you realise there be some limitation to atv s dom model for example I just notice that idl attribute content versus idl attribute be not work so that might be a problem then some element be conflict with html element that have the same name same issue for property name and so on in conclusion I think a custom react renderer for the apple tv would be the solution but the strange thing be that it would still be a dom renderer like react dom only configure for atv s element and attribute and patch for its dom implementation s quirk do you guy think this be feasible |
facebookreact | how to test child prop without trigger do not access prop of a dom node 0 14 | Question | I have a component whose job it be to add certain property to its child javascript const parent react createclass dostuff render const child react cloneelement this prop child dostuff this dostuff return child with 0 13 I could test it like this javascript const renderintodocument findrendereddomcomponentwithclass testutil const parent renderintodocument const child findrendereddomcomponentwithclass parent test expect child prop dostuff to equal parent dostuff what be the 0 14 way of test this ps I test the behavior of parent dostuff elsewhere but I also need to ensure that the give child get a reference to this method |
facebookreact | after call setstate with an es6 class instance as its argument this state become a plain object | Question | when react component getinitialstate method return an es6 class instance everything work fine this state in render mthod have the right type but when I call setstate with es6 class instance as its argument this state become a plain object javascript class state constructor text this text text get value return this text var main react createclass getinitialstate return new state es6 handleclick var state new state react this setstate state bad case emerge render console log type ok this state instanceof state return this state value click reactdom render document getelementbyid react wrap react 0 14 2 gulp babel 6 1 0 |
facebookreact | how to trigger the eventlistener that be register outside of the react component | Question | how to trigger the eventlistener that be register outside of the react component |
facebookreact | after server side rendertostre component claim it ismounte | Bug | if you keep a this reference at the componentwillmount lifecycle method of a component that be then render with rendertostre then this ismounted true later on the documentation however claim that server side component aren t really mount since componentdidmount be never call I think this behavior change in react 0 14 but that might be wrong |
facebookreact | weird component that can not be refer | Question | I use react and material ui for my app here be the part of code render return no name note playerlist map function player index return index 1 player name player note bind this onshowinfo index var player playerlist index console log this ref this ref playerinfodialog show this ref txtname setvalue player name this ref txtnotes setvalue player note what I want to do with this code be to generate row in a table of player list and while a row be tap a dialog show up with the datum of the row but the two textfield s with ref of txtname and txtnote can t be refer as on the last 2 line produce error the pic below be produce by console log in onshowinfo method I add some ref s with random name just to test ee77834e 7a46 4734 8480 2464e1d65382 |
facebookreact | prevent a function to be call from within render | Enhancement | you have a warning in react if you call setstate from within a render method with the check reactcurrentowner current null I would like to add this check to other method of my project because they also trigger rerender or be too expensive the issue I have be that reactcurrentowner be not expose by react so how can I achieve that the current solution I have in mind be to check from the stack trace but that s a lot more expensive than your check so I would prefer if there be something equivalent to your code but from outside react |
facebookreact | how to getelementbyid with testutil renderintodocument | Question | I m write some karma test renderer renderintodocument dom reactdom finddomnode renderer since renderintodocument doesn t actually render into document how may I find a component by i d |
facebookreact | page mess up facebook github io react html jsx html | Bug | do not know where to post this good since some week the layout look break on google chrome 43 linux screenshot selection 003 |
facebookreact | stateless function component do not work with native arrow function | Bug | when you blacklist es6 arrowfunction from babel the follow will stop work and you will get the error uncaught typeerror not a constructor js import react from react import reactdom from react dom const app hello world reactdom render document getelementbyid root |
facebookreact | press spacebar on a check radio button only fire click in some browser | Bug | 1 focus the textbox 2 press shift tab to move focus into the radio button group 3 press spacebar to check the radio button observe a click event in the console 4 press spacebar to redundantly check the radio button in chrome 45 0 2454 85 64 bit osx observe no additional click event in the console in firefox 40 0 3 osx observe an additional click event in the console this be entirely the browser fault but since react s synthetic event system be try to fully normalize inconsistency like this here s an obscure one for the list I at least prefer firefox s behavior I expect real click and synthetic keyboard originate click to have the same condition for fire incidentally this feel to I like it might ve be an accident in chrome rather than an explicit decision be there some place to file this bug with they I feel like that s pretty pie in the sky though p |
facebookreact | modding reacttransitiongroup to work with a wrap component | Question | I m not sure if this be the right repo to ask this question in but I figure I d start somewhere I be work on an app that use react router and redux use a library call react redux which expose a decorator to wrap the component and pass in datum from the store as prop so the component that get pass to reacttransitiongroup be actually a class call connect which have a property call wrappedcomponent where the actual component live since all the reacttransitiongroup lifecycle method be inplemente on the wrappedcomponent reacttransitiongroup be not find they I tire extend reacttransitiongroup and override the perform and handle method to also look for the lifecycle method on wrappedcomponent but I get the follow error unhandled promise rejection referenceerror reacttransitionchildmapping be not define here be a gist of the extended class I create if anyone could point I in the right direction I would appreciate it thank |
facebookreact | target value sometimes undefine | Bug | I loop my product list with map and create a react component for each item javascript var productlistitem react createclass handleevent function e console log e target value render function return this prop i d this prop name this prop quantity when I click on the button sometimes the e target value be define and sometimes undefine its totally random after click on the button 50 time the value set magically undefined |
facebookreact | how to unfold child | Question | hi I m write a library which use jsx as an abstract dsl a bit like react router have and or a bit like react canvas have and other primitive to explain my question I will take the example of react router an user could define a customroute component that render to a and use it like this afaik this win t be detect by the because just traverse the prop child be not enough router will see a child type customroute and win t understand it do you know if this be possible to solve this basically I want to descent the render tree and stop if it be not a user component it be a native component like or if I reach the I m look for |
facebookreact | change event do not fire in ie and edge under certain circumstance | Bug | I have put together this simple example to demonstrate the issue the problem be happen on select element if there be any mouse event listener attach that would trigger a render the onchange handler never get call it look like unlike other browser ie and edge trigger mouse event on the select element when click on the option but that should not prevent the change event from trigger |
facebookreact | checkbox check html attribute not set when underlie prop change | null | when render a checkbox the check html attribute be not be properly set to reflect the check prop of the component the problem seem to be that the setvalueforproperty method link l128 set the check property on the dom node object but this will not update the check html attribute as see in this fiddle the suggestion be instead to use setattribute to set the check property as it will set the underlie node property and the html attribute as see in the fiddle above |
facebookreact | should I set key for conditional component | Question | for example if I have two conditional child like javascript showa showb then should I set key for the child without key when diff between and will the result be remove a remove b insert b what if I have many conditional child like that I have a look at but could not figure out the answer thank for help |
facebookreact | get displayname from instance | null | hi I be extend react component to define component in scala js scala class test extend reactcomponent scala js code val displayname test def render react createelement div in react dev tool I be see no display name for all my component for some reason scala js output not get name from this function js get a text description of the component that can be use to identify it in error message return string the name or null internal getname function var type this currentelement type var constructor this instance this instance constructor return type displayname constructor constructor displayname type name constructor constructor name null l784 be it okay to modify this function to get displayname from instance before I break my head by dig to javascript prototype constructor the follow code work for I js get a text description of the component that can be use to identify it in error message return string the name or null internal getname function var type this currentelement type var constructor this instance this instance constructor return type displayname constructor constructor displayname type name constructor constructor name this instance this instance displayname null |
facebookreact | what be the differ between parent base context and child base context why the child base context will be lose | Question | I want to use the material ui for my react app I do the same as material ui say here be my code index js var react require react mui require material ui thememanager new mui style thememanager raisedbutton mui raisedbutton var index react createclass childcontexttype muitheme react proptype object getchildcontext function return muitheme thememanager getcurrenttheme render function return div raisedbutton label default div module export index reactapp js function var react require react addon var index require component index js var injecttapeventplugin require react tap event plugin window react react injecttapeventplugin react render index document body first I use the jsx tool to compile this two file and then I use browserify to browserify the reactapp js to main js and add it to my page index html but it report this warning owner base and parent base context differ value undefine vs object object for key muitheme while mount paper see uncaught typeerror can not read property component of undefined backgroundcolor this context muitheme component paper backgroundcolor I do get to the but do not make any sense so how do I solve this |
facebookreact | react with facebook s comment | Question | hi I have a page completely write in react so in html template be only a and I have to use comment widget from facebook I come up with js react render create document getelementbyid app function function d s i d var js fjs d getelementsbytagname s 0 if d getelementbyid i d return js d createelement s js i d i d js src connect facebook net en us sdk js xfbml 1 version v2 4 fjs parentnode insertbefore js fjs document script facebook jssdk but the code above mutate the dom which be against react s philosophy and let s assume that facebook rewrite this plugin to react so there would be two react app react inside react be it ok to include facebook s comment like this or be I completely on a wrong path be it ok to have one react app inside another one e g a video player inside a page |
facebookreact | question dynamic context | Question | I be try to have locality specify throughout my app I think that use context could be a good solution for this to achieve this I need to let the user dynamically change their locale should dynamically change the context have any negative consequence I have test it and it work but want to make sure there will not be any negative consequence |
facebookreact | how to import react npm compoent in jsx file | Question | hello I be freshman of react I use gulp to build web asset I compile all jsx file with gulp react to js like this javascript gulp src path appjsx pipe concat app jsx pipe react but now I want to use some react component register in npm such as react iscroll I don t know how to introduce it in my jsx file if I directly add bellow to jsx file t top it win t work well javascript my component jsx file var react require react reactiscroll require react iscroll iscroll require iscroll how I import they rightly thank regard |
facebookreact | callback ref be pass null and then the component again | Bug | I have a super simple react native component with a static root with a callback ref when the component be mount the callback ref be invoke with the root component then when I call setstate the callback ref receive null and then the root component again js class example extend react component constructor prop context super prop context console log in the constructor render return console log get ref component style this prop style componentdidmount console log in componentdidmount this setstate the console log read in the constructor get ref r s c s constructor prop object context object ref object updater object state null in componentdidmount get ref null get ref r s c s constructor prop object context object ref object updater object state null the null ref be confusing to I since the ref d view isn t unmounted nor be its parent I believe this be under 0 14 beta 1 whatever rn master use |
facebookreact | be defensive when call method of a syntheticevent inside the pool | Enhancement | as it be know but not document react s syntheticevent be pool this be confuse for many user as they don t understand why the event start to behave strangely when use in an async callback like inside a settimeout a setstate or a render callback there have already be an attempt to solve this problem here the code of syntheticevent s default method be javascript preventdefault function this defaultprevente true var event this nativeevent if event preventdefault event preventdefault else event returnvalue false this isdefaultprevente emptyfunction thatreturnstrue stoppropagation function var event this nativeevent if event stoppropagation event stoppropagation else event cancelbubble true this ispropagationstoppe emptyfunction thatreturnstrue it may make sense to be more defensive because call event preventdefault on a pool event will raise can t call preventdefault on null it would be more useful to add a check like if this nativeevent throw new error baaad you be use a pooled event |
facebookreact | yet another invariant violation reactmount two valid but unequal node with the same datum reactid | Bug | I m experience an unexpected error relate to native dom event create in an owner component and trigger by dom element render by own component there s be a number of seemingly relate issue the close being 3790 but this might be a different edge case so I think I d create a new issue for it reproduction I ve try to whittle this down as much as possible the jsfiddle be use 0 13 3 but I get the same error use 0 14 0 beta1 step 1 click go to two 2 click go to one 3 click go to two the second time component two be render react throw invariant violation reactmount two valid but unequal node with the same datum reactid note as I be try to narrow down the cause I find that under the follow scenario no error will be throw 1 an onclick prop with an empty function onclick function be add to the a element in component one see 2 the input element in component two be remove leave the form element see 3 the return value of the render method of component one and two be inline in the render method of the main component I e everything be render by a single component see 4 only when use 0 14 0 beta1 the form element in component two be remove leave the input element sorry no fiddle be 0 14 0 beta1 on a cdn this still throw in 0 13 3 thank |
facebookreact | onmouseleave can be unreliable in chrome | Bug | see this jsfiddle in chrome as you quickly move your mouse up and down the list you ll notice that some get stick in the hover state this work fine in safari and work in chrome if you use a stable key between the hover state I think mouseout somehow isn t fire if the underlying dom node be replace by a new one in the same tick but it s odd that this be a chrome only bug |
facebookreact | update datum from rest api | Question | jsx var app react createclass getinitialstate function return datum 1 updatedata function this setstate function state this getdata1 state function state datum return data getdata1 function state cb get function result datum datum result state datum result cb state datum render function return this state datum I have try this to update state but this be not work only way to update be manully comment portion even then it only render on second click can you tell I proper way to update state use rest api call |
facebookreact | unexpected behavior of findrendereddomcomponentwithtag in react 0 14 beta1 | Bug | after migrate from 0 13 to 0 14 beta1 some of our unit test be report false positive failure it seem as though findrendereddomcomponentwithtag be no long able to find element inside component javascript create simple component const test react createclass render return render into document const myelement reacttestutil renderintodocument make sure component have an svg element const svg reacttestutil findrendereddomcomponentwithtag myelement svg oop this fail in 0 14 with do not find exactly one match for tag svg however this work just fine console log finddomnode myelement childnode 0 return element |
facebookreact | testutil simulate change keydown keypress be not work on a normal input field | Question | I m have a hard time with testutil simulate which be definitely not behave as expect basically I have an input field of type text and I try to change it s content click it and press some key no rocket science but all the editing stuff fail miserably I write a small jsbin to showcase what the component I m test should do and I ve also write a small repo to showcase the fail test what s go on p s the bin be run on 0 13 1 while the repo be run on 0 12 2 because that be what I m use still nevertheless I ve also try with 0 13 3 and it keep fail |
facebookreact | how re render should be do in efficient way while datum change in flux architecture controller | Question | I have a controller which consist of many view in it only my controller be have state and I pass datum to my view through prop now problem be suppose my view depend on number of product say we have more than 100 product and each product consist of number of property relate to it now each property also have their own property on it so if I change value of a sub property then I have to re render no we dispatch the change event so it again start re render from controller and it have to process through all the code like all condition check loop etc which be time consume so how should we achieve it flux react architecture |
facebookreact | rendertostre incorrectly support select s defaultvalue | Bug | here be code for reproduce js var test react createclass render function return this prop item map I I var container document getelementbyid container var code document getelementbyid code var test var prerender react rendertostre test code innertext prerender replace n container innerhtml prerender settimeout react render test container 1000 so I m render select on the server and get small lag on the client |
facebookreact | checksum insert incorrectly for self closing root tag | Bug | this come up while diagnose 4321 issuecomment 120064258 this be because we just look for the closing when add the checksum reactdom rendertostre react createelement img reactdom rendertostre react createelement div null react createelement img |
facebookreact | example of use testutil simulate change on a multiple select field | Bug | hi I be try to find a work example of drive a multiple select element use react s testutil for a single select this work fine javascript testutil simulate change el target value 1 for a multiple select field you get an error typeerror array prototype slice call on null or undefined if instead pass an array of argument to change it doesn t seem to be trigger the change handler or be reflect in the component state javascript testutil simulate change el target value 1 doesn t seem to trigger any change in component state apology if I m miss something obvious but if anyone know of the proper way to do this any help would be appreciate thank |
facebookreact | keyboard selection doesn t fire onchange for in firefox | Enhancement | relate bug in bugzilla my workaround for this be to use onkeydown allow the selection to change then call an onchange handler manually but this win t bubble be this something changeeventplugin could support |
facebookreact | mouseenter fire on disabled input whereas mouseleave do not | Bug | there be an asymmetry to enterleave event plugin since mouseenter be create from the relativetarget of the mouseout event it fire even though the target be disable since the mouseleave be the inverse I e require that the disabled element fire a mouseout it doesn t fire a mouseleave for the disabled element I be pretty sure the correct behavior here be that neither event should fire if its target be disable since this mirror mouseout no idea if none chrome browser have the same behavior for which mouse event fire on disabled element additional caveat I just realize react be probably also not fire mousenter event in the case where the mouse leave a disabled element into a non disabled element |
facebookreact | two different output from terminal and web inspector incorrect view render | Question | I be have trouble with generate my view with reactjs I have these two view which I would like to generate var test1 initial loggedin var test2 notloggedin var initial var isloggedin false var layout react createclass componentwillmount function try if window window user initial window user name first 0 touppercase window user name last 0 touppercase isloggedin true catch e ignore render function if isloggedin console log window user console log initial return test1 else console log not log in return test2 when I run this code I have 2 different output from my terminal and my web inspector terminal 1 render server side react 1 not log in web inspector object username bli1 userid 1298085750 address 127 0 0 1 name object email bl the first and second output from console log window user and console log initial be display above I be not sure why this be occur I m not sure how to handle this to achieve the desire logic the view display on my broswer be that of test2 |
facebookreact | reacttestutil rename find scry pair to findone findall or similar | Enhancement | outside of the relatively unknown word scry be use it s difficult for someone to tell just by name how these differ the current name seem to be base on the original jx dom scry api usage base on 3278 so likely make more sense internally but as with the person that file 2301 it would be much more discoverable and easy to use with name that be more obvious for what they do for back compat reason rename they and then add the exist name as pointer with comment jsdoc say they re deprecate probably make more sense imho thank |
facebookreact | in component render method how to get future container s width height | Question | I want to write a layout component width will take 200px width will take the rest width of container how to get the future container s width height |
facebookreact | unnecessary encoding of element text content | Enhancement | give the follow piece of code javascript let some text hello world react render some text somewhere react replace the angle bracket quotation mark apostrophe and ampersand with their html entity ie lt gt quot amp etc I don t believe it be necessary to replace the quotation mark or the apostrophe they don t need escape they would only need escape when use in an attribute not when use as the text content of an element the reason I notice this be because I m try to encode some json into a html element on the server side which can then be read back by the client side javascript json contain a lot of double quotation mark and they re all be needlessly replace by quot s |
facebookreact | html tag in component prop | Question | hi I m new in react development and I m not english so I have some difficulty to understand all thing which be possible in react well here I would like to use some html tag in prop for a component for example if I have this component var card react createclass render function return this prop title this prop child I would like to use it like that content but the title div mes infor div still be the same whereas I would like to have a div with inside the real title so I don t know how to use the prop of component to have my result sorry for my poor english |
facebookreact | react can mount with but do not update placeholder attribute | Bug | hi I don t really know if this be expect but the follow var hello react createclass render function return hello react render document body will lead to hello it seem that react do not mount the test attribute because it s not standart but actually it mount the placeholder attribute while it be not standart too be this expect so react can mount a div with a placeholder attribute in its current state but the weird thing be that it can t update this attribute var hello react createclass render function return hello react render document body react render document body this will produce hello see don t know how this be suppose to work but I think the current behavior be kind of unexpected |
facebookreact | uncaught error unable to find element when update the innerhtml of an option element | Bug | my co worker and I be catch off guard by this behaviour yesterday and I want to see if this be a possible react bug or some misunderstanding on our part basically it seem have more than one part to the innerhtml of an option element and then try to update one of they will throw the error uncaught error invariant violation findcomponentroot 0 1 0 0 unable to find element this probably mean the dom be unexpectedly mutate e g by the browser usually due to forget a when use table nest tag like or or use non svg element in an parent try inspect the child node of the element with react i d we have work around it by combine the part into a single variable and then use that here be the jsfiddle demonstrate the error here be what we ve do as a workaround be I do something wrong or be this something that should be possible with react |
facebookreact | bad interaction between react click event handler and native click event handler | Bug | in this repro I create 2 button and only one be render at a time one button s click handler be hook up to react s synthetic click event while the other be hook up to the native click event even though only one button be render at a time a single click be trigger both click event this bug can be hit by app that mix react component with non react control e g jquery ui repro step I reproe this in chrome with react 0 13 2 1 go to 2 click the button label one expect there s a button render label two actual the render button still have the label one if you open the console you ll see gototwo and gotoone which indicate that the one button s click handler run and then the two button s click handler run even though we never see button two |
facebookreact | react s blur may not have relatedtarget in ie 9 11 where it be support | Bug | reactbrowsereventemitter have some handling for onblur and onfocus see l262 l293 react will first check if it can trap focus with a capturing event use addeventlistener if it can t and the browser support focusin then it will use focusin however there be a problem with this pattern internet explorer implement relatedtarget on focusin and focusout but it do not implement it in focus and blur as of ie 9 ie support addeventlistener and trap capturing event this mean that ie 8 and before react will have relatedtarget on onfocus and onblur handler but in ie 9 11 relatedtarget will be null in react s onfocus and onblur handler even though ie would support it if focusin and focusout have be use |
facebookreact | component render null always trigger a dom update | Bug | you can see the behavior in this fiddle basically the thing be that the tag be always be update in the dom check the element view with the chrome inspector to see the element update this doesn t happen if the component explicitly return a instead of null |
facebookreact | change event be not fire for input type date | Bug | hello it seem like change event be not fire for input type date in mobile firefox on android please try the follow jsfiddle code for example may be I m do something wrong but the above code work well in chrome safari and desktop firefox but not in mobile firefox test in firefox v 37 0 1 on android 5 1 just in case vanilla javascript work well in this case thank you in advance andrei |
facebookreact | should I use statefy | Question | hey folk we re implement a set of react component and because of what I explain in the motivation section we create statefy the problem be I m not sure if it s a good practice I m afraid of use it in a large number of component just to find out it would be way well to do it in another way could you please give your feedback on this project that would be much appreciate thank |
facebookreact | set attribute style to null break this attribute | Bug | when I assign null to style attribute to reset it it work but only once any follow change of this value do nothing here s a fiddle demonstrating this try to push the button several time this seem like a strange behaviour to I I wouldn t be surprise if my first attempt to set style null fail but it doesn t and it silently break the style attribute |
facebookreact | replacestate throw away function in 0 13 | Bug | I m still learn react so it s possible I m misunderstand something I m try to use react with immutable js and hit a stumbling block by upgrade to react 0 13 there be wiki page on the immutable js repository that explain how to use immutable as a react state and it provide the following example I transpile it to es3 js use strict var react require react var immutable require immutable var component react createclass getinitialstate function return immutable map count 0 handleclick function this replacestate this state update count function v return v 1 render function return this state get count react render document body this work great in 0 12 but in 0 13 you will receive the follow error when click on the div typeerror this state get be not a function this state get count put a breakpoint on the error and inspect this state with a debugger reveal that all the method on this state have disappear be this the expect behavior in 0 13 |
facebookreact | allow prop to be a plain string specify classname | null | a tiny low impact basically non break change that I find make a big difference to succinctness when render without jsx I ve add a minimal test check lint and submit the cla render declaration tree tend to frequently include instance of div and span which only have classname and nothing else because they re purely structural and provide a way for css to inject styling also with es destructure assignment I can say var dom div span p input button react this succinctly import frequently use element into the scope and combine with this pull request allow I to write render function like this render return div container div head span column1 span column2 div blah this make it somewhat more succinct than jsx the prior code be write to assume that prop be an object so this change simply check for a string and convert it to an object with a property classname regard static typing no change be require to the react d ts file on definitelytyped because all the property of htmlattribute be optional so string already conform to it furthermore designer of component could optionally support a classname property in their prop if they want to be able to accept a string in this way which they could then interpret however they wish although the main purpose here be to make plain dom element more succinct |
facebookreact | invoke rendertostaticmarkup in render cause ref to break | Bug | demonstrate at open the error console and you should see this uncaught error invariant violation addcomponentasrefto only a reactowner can have ref this usually mean that you re try to add a ref to a component that doesn t have an owner that be be not create inside of another component s render method try render this component inside of a new top level component which will hold the ref js var bug react createclass render function var html react rendertostaticmarkup react dom img return react dom div ref ref html bug react createfactory bug react render bug document body |
facebookreact | context not update on component mount with react render | Bug | this be tough for I to explain so I create a fiddle to demonstrate it I have a layer portal whatever we be call this pattern that render the child of a component to a new tree off of body via react render I would expect context to also be pass and I ve take special care to make sure the child to be pass to render be create with the correct owner it all work fine context be pass but it be never update at that point if I inspect the child element to be pass context be correct but context be never update on the instance not sure if perhaps I just have the wrong expectation here here be an illustration update with simple example |
facebookreact | allow extraction of primative from reactfragment extract | null | we already allow it but this ensure that we allow it in dev too |
facebookreact | node proptype validation hit error with null value | Bug | js var foo react createclass proptype child react proptype node render function return parent this prop child var demo react createclass render function return react render document body warning fail proptype fragment be null check the render method of demo firefox warning fail proptype can not read property reactfragment of null check the render method of demo chrome cc kassen |
facebookreact | how do I encapsulate style | Question | hi we be convert a big project write with polymer to react the big problem we face be the lack of encapsulate styling I would like to encapsulate my sass file with encapsulate style among my component in the entire react web site and documentation there be almost no mentioning of style furthermore in chrome devtool under react plugin you have all the component property except style not like devtool of the regular dom I really like react and what your do so how be you go to approach this problem |
facebookreact | call setstate without getinitialstate throw when use purerendermixin | Enhancement | without getinitialstate this state be null which cause this line in shallowequal to throw js if objb hasownproperty key obja hasownproperty key fix be to make shallowequal bail if either argument be falsey or not an object if we want to be very safe |
facebookreact | typeerror when parent component be update after uncaught exception in child component s componentwillmount | Bug | expect result render text there be an error actual result uncaught typeerror can not read property unmountcomponent of undefined jsfiddle the code js var parent react createclass getinitialstate function return error false componentwillmount function var self this window onerror be only use for brevity window onerror function if self ismounte self setstate error true render function if this state error return there be an error else return var child react createclass componentwillmount function throw new error test error render function return child react render document body |
facebookreact | mozmacosxfontsmoothing be render incorrectly | Bug | the firefox equivalent of webkit font smoothing be moz mac osx font smooth react s serialization of this style prop be incorrect moz mac o s x font smoothing see this fiddle in firefox if the initial state be suppose to enable font smoothing via innerhtml it break but subsequent update which use the dom api work |
facebookreact | react fail to unmount component from within event handler | Bug | hi when try to unmount my whole app I get some error uncaught typeerror can not read property firstchild of undefined reactmount js 606reactmount findcomponentroot reactmount js 606reactmount findreactnodebyid reactmount js 552getnode reactmount js 128executedispatch eventpluginutil js 109simpleeventplugin executedispatch simpleeventplugin js 305foreacheventdispatch eventpluginutil js 95executedispatchesinorder eventpluginutil js 119executedispatchesandrelease eventpluginhub js 46foreachaccumulate foreachaccumulate js 25eventpluginhub processeventqueue eventpluginhub js 251runeventqueueinbatch reacteventemittermixin js 18reacteventemittermixin handletoplevel reacteventemittermixin js 44handletoplevelimpl reacteventlistener js 80mixin perform transaction js 134reactdefaultbatchingstrategy batchedupdate reactdefaultbatchingstrategy js 66batchedupdates reactupdate js 109reacteventlistener dispatchevent reacteventlistener js 175 I think it s not a big deal accord to what I see with the debugger it seem to be because a syntheticmouseevent be try to get dispatch and I guess the target have just be unmounted note that my use case look like this javascript var hello react createclass render function return hello this prop name when use an unmount synchronous implementation I get this error when add a settimeout 0 in the unmount code I get no error I could not reproduce this in a jsfiddle but I guess it s probably because I don t really know how batch work in react |
facebookreact | call super method of react component child | null | I have inheritance in my app show below I be use babeljs transpiler 6to5 and call super method generate an exception js class component extend react component class mycomponent extend component componentdidupdate super componentdidupdate here error could not call an undefined do smth I think the easy solution be to add empty method in react component class or do I do something wrong |
facebookreact | jsxtransformer break when create source map and defineproperty not available | Bug | if jsxtransformer be call with sourcemap true as an option but the javascript environment do not have object defineproperty the transformation die here with an object doesn t support property or method defineproperty exception the list of original source object defineproperty sourcemapconsumer prototype source this should degrade more gracefully and simply turn off source map if not available if I pass sourcemap false rather than true everything work fine so it just seem like some code need to be gate with an environment check there do appear to be some logic in jsxtransformer to try and detect this but it seem like this check be either incomplete or some other code also need to be wrap in this check the source map library rely on object defineproperty but ie8 doesn t support it fully even with es5 sham indeed es5 sham s defineproperty throw when object prototype definegetter be miss so we skip build the source map in that case var supportsaccessor object prototype hasownproperty definegetter also see |
facebookreact | warn when react dom modify by not react | Enhancement | as discuss in issuecomment 75181038 a complementary improvement be to turn on a mutation observer in dev and warn of someone other than react modify the dom and or if dom node appear without a data reactid thus indicate an extension or some other script be do fancy magic |
facebookreact | createnodesfrommarkup render with global document | Bug | apparently we support render into iframe petehunt but we always render new markup into the global document and then move render element into the iframe document afterwards jsdom throw wrong document if you try to do this but browser don t seem to mind however apart from perhaps not be very nice for various reason it seem to affect performance significantly ie11 drop down to 33 performance and ff drop to about 20 when render into the global document and move rather than render directly into the iframe document this be easily solve everywhere except for processupdate as render into different document be batch as well cc spicyj zpao |
facebookreact | strict proptype mode | Duplicate | it would be nice to be able to set a flag that will trigger invariant warning any time a prop be reference from or pass into a component but that be not declare in proptype |
facebookreact | this forceupdate crash when a component be not mount | Duplicate | not sure if it be a bug or just general confusion try only with 0 12 2 not with master this forceupdate crash when a component be not mount which in itself make sense I d say however if you call this forceupdate directly in componentwillmount it doesn t crash which suggest that it s ok to do just as setstate be ok to call there this happen if you use a flux like architecture but don t use the componentdidmount setstate combination as flux suggest but componentwillmount forceupdate the error that you get be invariant violation receivecomponent can only update a mount component this example show the problem |
facebookreact | reactmount nodecache be repopulate with purge node that be focus at unmount | Bug | if you unmount a currently focus node nodecache be repopulate after be purge and unless that specific i d be revisit later it will remain there forever this be mostly likely due to the focus selection restoration phase after reconciliation repro nodecache be output into the console |
facebookreact | question about immutable datum and react | Question | it may sound like a noob question or just crazy but I ask anyway so dom diff may be replace with immutable datum diff it s much fast and sane if we require of state to be immutable can not we drop dom diff entirely and all this virtual dom altogether most of react code actually it will require from we to explicitly declare every form field state not a big deal event be just derivative of architecture not vice versa as in jquery I believe what I m miss |
facebookreact | q transfer state from server | Question | I wonder if it s possible to transfer state and or prop from server to client I imagine way like stringify parse json to achieve it how to do that properly or I should use ajax for initial state even in isomorphic webapp |
facebookreact | when return null tag be always rerendere | Bug | tl dr if you have a component that return null and it rerender the noscript tag be unmounted and a new one be create because shouldupdatereactcomponent get and null and return false this come out of some internal component that be break after the most recent update I haven t go to see if this be more widely break it might have be before any of the recent update just that the empty component be trigger it reliably I ve be some report of have similar weird problem that we couldn t track down it s use of localeventtrapmixin be very similar to what s happen in reactemptycomponenttype the trigger here be that we re trigger an update during the mount phase when we do this work correctly because it s before which be trigger parent to rerender be the broken one because its componentdidmount hasn t be call yet so we actually call its componentwillunmount first then we still call its componentdidmount there s also the whole question of why we re try to unmount anything at all here it seem like we shouldn t be do that cc sebmarkbage spicyj drop this into example basic jsx harmony and debug with pause on catch exception I add some breakpoint in reactemptycomponent to make it super obvious js use strict var child react createclass componentdidmount this prop onmount this prop onmount render if this prop visible return null return hello world var parent react createclass update this forceupdate render return react render document getelementbyid container |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.