| {"query_id": "q-en-react-ab535627950c5c4f6788fdc21c9855588e086629d351666b24466bad463969c7", "query": "Nor sure what that means other than that the tests are flakey :'(\nhttps://travis-\nhttps://travis-", "positive_passages": [{"docid": "doc-en-react-8faba1735f6b2d17744137e2793573e876d08674a943e100ee050b84816a75af", "text": "function getJSReport(browser){ return browser <del> .waitForCondition(\"typeof window.jasmine != 'undefined'\", 5e3) </del> <ins> .waitFor(wd.asserters.jsCondition(\"typeof window.jasmine != 'undefined'\"), 5e3, 50) </ins> .fail(function(error){ throw Error(\"The test page didn't load properly. \" + error); }) <del> .waitForCondition(\"typeof window.jasmine.getJSReport != 'undefined'\", 10e3) .waitForCondition(\"window.postDataToURL.running <= 0\", 30e3) </del> <ins> .waitFor(wd.asserters.jsCondition(\"typeof window.jasmine.getJSReport != 'undefined'\"), 60e3, 100) .waitFor(wd.asserters.jsCondition(\"window.postDataToURL.running <= 0\"), 30e3, 500) </ins> .eval(\"jasmine.getJSReport().passed\"); }", "commid": "react_pr_635"}], "negative_passages": []} | |
| {"query_id": "q-en-react-ab535627950c5c4f6788fdc21c9855588e086629d351666b24466bad463969c7", "query": "Nor sure what that means other than that the tests are flakey :'(\nhttps://travis-\nhttps://travis-", "positive_passages": [{"docid": "doc-en-react-4734459bb16532eb5aafa8f3bbb5dd04693fbfbd22abcd7e1fb13c89b20cc667", "text": "urls.unshift('../node_modules/es5-shim/es5-shim.js'); } <del> var cacheBust = '?_=' + Date.now().toString(36); </del> <ins> var cacheBust = '?_=' + (+new Date).toString(36); </ins> for (var urls_index = -1, urls_length = urls.length; ++urls_index < urls_length;) { document.write('<script src=\"' + urls[urls_index] + cacheBust + '\"></script>');", "commid": "react_pr_635"}], "negative_passages": []} | |
| {"query_id": "q-en-react-53bf20fc49b7919c57503cee6ac4dd93f525eb831331357f4f8c4664531d7a75", "query": "Passing a function with some properties (simply the wrong thing) into yields rather cryptic: especially since the message says it is not the caller's fault.\nOne could add an invariant to But it is strange that the invariants in and don't mention arrays and objects, respectively.\nis also a very contextual name (I have no idea what the author meant). I agree that these messages could be better.", "positive_passages": [{"docid": "doc-en-react-3007f0673be52064524a00db56e1c9591a291cecd9b1d55e789410281772ed12", "text": "* @protected */ setState: function(partialState, callback) { <ins> invariant( typeof partialState === 'object' || partialState == null, 'setState(...): takes an object of state variables to update.' ); if (__DEV__){ if (partialState == null) { console.warn( 'setState(...): You passed an undefined or null state object; ' + 'instead, use forceUpdate().' ); } } </ins> // Merge with `_pendingState` if it exists, otherwise with existing state. this.replaceState( merge(this._pendingState || this.state, partialState),", "commid": "react_pr_822"}], "negative_passages": []} | |
| {"query_id": "q-en-react-53bf20fc49b7919c57503cee6ac4dd93f525eb831331357f4f8c4664531d7a75", "query": "Passing a function with some properties (simply the wrong thing) into yields rather cryptic: especially since the message says it is not the caller's fault.\nOne could add an invariant to But it is strange that the invariants in and don't mention arrays and objects, respectively.\nis also a very contextual name (I have no idea what the author meant). I agree that these messages could be better.", "positive_passages": [{"docid": "doc-en-react-bf5798b90c09f75d39944d2b957e97fc266706845ce1d800e084eabfffafd0d5", "text": "checkMergeArrayArgs: function(one, two) { invariant( Array.isArray(one) && Array.isArray(two), <del> 'Critical assumptions about the merge functions have been violated. ' + 'This is the fault of the merge functions themselves, not necessarily ' + 'the callers.' </del> <ins> 'Tried to merge arrays, instead got %s and %s.', one, two </ins> ); },", "commid": "react_pr_822"}], "negative_passages": []} | |
| {"query_id": "q-en-react-53bf20fc49b7919c57503cee6ac4dd93f525eb831331357f4f8c4664531d7a75", "query": "Passing a function with some properties (simply the wrong thing) into yields rather cryptic: especially since the message says it is not the caller's fault.\nOne could add an invariant to But it is strange that the invariants in and don't mention arrays and objects, respectively.\nis also a very contextual name (I have no idea what the author meant). I agree that these messages could be better.", "positive_passages": [{"docid": "doc-en-react-27ce1f5c9dc1f4b83ec14da9bdb62fb7c8e671e4406e25c42cdaee2a7bc06ea0", "text": "checkMergeObjectArg: function(arg) { invariant( !isTerminal(arg) && !Array.isArray(arg), <del> 'Critical assumptions about the merge functions have been violated. ' + 'This is the fault of the merge functions themselves, not necessarily ' + 'the callers.' </del> <ins> 'Tried to merge an object, instead got %s.', arg </ins> ); },", "commid": "react_pr_822"}], "negative_passages": []} | |
| {"query_id": "q-en-react-5360ec7ebda3ce89021bda97c98ba633343da1ad01a2cb94b0daeb001278e958", "query": "Firs, it's unitless. I've seen a hack where the value is being specified as to make it pass the check and skip our adding of 'px'. Further, is actually a shorthand property, so we should support the expansion into the right properties.\nI don't think we need to do anything special for shorthand properties except for the list needed only for IE8.\nrelated: there are also some obscure css properties that can be unitless: Edit: + widow, - counter-*\nWhile we're at it, is also unitless. The properties mentioned in the above link don't actually take a single number.\nI'm not saying it's a great idea, just putting it out there... but what if we switched over to , , , , , etc. Not the prettiest, but perhaps prettier than and you can now access unmodified traditional CSS behavior and if you want to use the short-hand style, it's obvious and unambiguous, and not limited to just . It doesn't modify expected behavior, it doesn't conflict... philosophically that's up to you. :) ...speaking with people in the chat, I agree that it's a bad idea... however, seeing other peoples gripes with how React doesn't vendor-prefix, etc, etc. Perhaps the real solution is for React to export a settable where we can supply our own behavior and leave all of this outside of React itself, if you want to auto-suffix , use the addon. And this is a bad idea as well as it would prevent reliably sharing components. is currently ambiguous as it supports unitless and and thus we cannot auto-suffix it...\nline-height 'px' is used 15x-50x more times than unitless, em or percentage on fb codebase. I feel like this should be the default and we should provide a more verbose way to use it in an unitless way.\nI agree, my only issue with that is that we would explicitly break with the CSS standard then.\nMy view on this is that the CSS standard is only using strings. So if you say '1.5', React is just going to output '1.5'. Now if you say 23 (the number), then React is going to be able to add any convenience it wants, such as adding 'px' as it's the most common use case.\nIt doesn't conflict today (probably never will but still). Also, do we now want to add , , (and so on for each numeric unit)? I think I'm more likely to go for forcing a unit if you want one. (eg, doesn't get converted to , you have to put the in yourself).\nMy idea with having the units as a suffix of the name is that it could be a universal test for all properties (for simplicity). If , or whatever is at the end the property name, we remove it and add it to the value instead. That way the only thing we would need to hard-code is which units are allowed, so the implementation would be minimal and barring any new units, future proof. While it theoretically could conflict, I don't see how it ever could, the units have very non-wordy names (case would obviously be taken into account as it already is). However, a practical issue is what to do if there are multiple units specified for the same property. So I definitely see that this may not be the favored way to go, just putting it out there :) I like idea, but I feel like it would be hair thin separation of the two and possibly \"dangerous\"... but it is neat, and likely what the user intended.\nFixed by -- we can discuss units more on a separate issue if needed.", "positive_passages": [{"docid": "doc-en-react-cec87f280fa9de2093b22995f60bc68c6f34138f838f6de2034bd3beca51ce39", "text": "* CSS properties which accept numbers but are not in units of \"px\". */ var isUnitlessNumber = { <ins> columnCount: true, </ins> fillOpacity: true, <ins> flex: true, flexGrow: true, flexShrink: true, </ins> fontWeight: true, lineHeight: true, opacity: true, <ins> order: true, </ins> orphans: true, <ins> pitchRange: true, richness: true, stress: true, volume: true, widows: true, </ins> zIndex: true, zoom: true };", "commid": "react_pr_861"}], "negative_passages": []} | |
| {"query_id": "q-en-react-5360ec7ebda3ce89021bda97c98ba633343da1ad01a2cb94b0daeb001278e958", "query": "Firs, it's unitless. I've seen a hack where the value is being specified as to make it pass the check and skip our adding of 'px'. Further, is actually a shorthand property, so we should support the expansion into the right properties.\nI don't think we need to do anything special for shorthand properties except for the list needed only for IE8.\nrelated: there are also some obscure css properties that can be unitless: Edit: + widow, - counter-*\nWhile we're at it, is also unitless. The properties mentioned in the above link don't actually take a single number.\nI'm not saying it's a great idea, just putting it out there... but what if we switched over to , , , , , etc. Not the prettiest, but perhaps prettier than and you can now access unmodified traditional CSS behavior and if you want to use the short-hand style, it's obvious and unambiguous, and not limited to just . It doesn't modify expected behavior, it doesn't conflict... philosophically that's up to you. :) ...speaking with people in the chat, I agree that it's a bad idea... however, seeing other peoples gripes with how React doesn't vendor-prefix, etc, etc. Perhaps the real solution is for React to export a settable where we can supply our own behavior and leave all of this outside of React itself, if you want to auto-suffix , use the addon. And this is a bad idea as well as it would prevent reliably sharing components. is currently ambiguous as it supports unitless and and thus we cannot auto-suffix it...\nline-height 'px' is used 15x-50x more times than unitless, em or percentage on fb codebase. I feel like this should be the default and we should provide a more verbose way to use it in an unitless way.\nI agree, my only issue with that is that we would explicitly break with the CSS standard then.\nMy view on this is that the CSS standard is only using strings. So if you say '1.5', React is just going to output '1.5'. Now if you say 23 (the number), then React is going to be able to add any convenience it wants, such as adding 'px' as it's the most common use case.\nIt doesn't conflict today (probably never will but still). Also, do we now want to add , , (and so on for each numeric unit)? I think I'm more likely to go for forcing a unit if you want one. (eg, doesn't get converted to , you have to put the in yourself).\nMy idea with having the units as a suffix of the name is that it could be a universal test for all properties (for simplicity). If , or whatever is at the end the property name, we remove it and add it to the value instead. That way the only thing we would need to hard-code is which units are allowed, so the implementation would be minimal and barring any new units, future proof. While it theoretically could conflict, I don't see how it ever could, the units have very non-wordy names (case would obviously be taken into account as it already is). However, a practical issue is what to do if there are multiple units specified for the same property. So I definitely see that this may not be the favored way to go, just putting it out there :) I like idea, but I feel like it would be hair thin separation of the two and possibly \"dangerous\"... but it is neat, and likely what the user intended.\nFixed by -- we can discuss units more on a separate issue if needed.", "positive_passages": [{"docid": "doc-en-react-50d5598a1ecf06b53398ae235a982412740b4603ea301eacccd3469d4802bd3d", "text": "}); it('should not append `px` to styles that might need a number', function() { <del> expect(CSSPropertyOperations.createMarkupForStyles({ fillOpacity: 1, fontWeight: 2, opacity: 3, orphans: 4, zIndex: 5, zoom: 6, lineHeight: 7 })).toBe( 'fill-opacity:1;font-weight:2;opacity:3;orphans:4;z-index:5;zoom:6;' + 'line-height:7;' ); </del> <ins> var unitlessProperties = [ 'columnCount', 'fillOpacity', 'flex', 'flexGrow', 'flexShrink', 'fontWeight', 'lineHeight', 'opacity', 'order', 'orphans', 'pitchRange', 'richness', 'stress', 'volume', 'widows', 'zIndex', 'zoom' ]; unitlessProperties.forEach(function(property) { var styles = {}; styles[property] = 1; expect(CSSPropertyOperations.createMarkupForStyles(styles)) .toMatch(/:1;$/); }); </ins> }); it('should set style attribute when styles exist', function() {", "commid": "react_pr_861"}], "negative_passages": []} | |
| {"query_id": "q-en-react-3d826d584ae12d0c851bfe45a8a182c34466d0f4c7bfb597962db7b869770dda", "query": "When I run jsx --watch src/ build/ it compiles the jsx files and create a file in the build directory. On the next jsx file modification, the jsx process crashes. Once the is present, jsx won't compile jsx files even when ran manually. I use OSX Maverick and jsx 0.8.13.\nAFAIK this is a \"bug\" with or whatever JSX relies on to expose that feature. Just make sure to close the watch instance instead of just closing the terminal/powering down and it should be fine.\nDoes it work again if you remove the file?\nYes it does. Oh or wait, the crashing.\nIt seems like there are two ways of fixing this. We can either out why is not cleaning up the file when the process exits, or the functionality and just hope people don't accidentally have multiple processes targeting the same output directory. I'm pretty comfortable with option 2, honestly. Thoughts,\nYeah, no lock seems fine for me, it could warn if it was found perhaps? Another thing to mention that has been happening to me, I'm using React through a Linux VM and accessing the filesystem through samba. When saving a file it immediately triggers a recompile before the file has finished saving, causing it to error. Shortly after it recompiles it again, so no harm, but it's worth noting.\nI'm fine with no locking. I didn't even know that existed. Do what works!", "positive_passages": [{"docid": "doc-en-react-67f9022d491ffeba0e3f72f5cd6879bf0df3b76370ab9dbcfaf7a50cc425e302", "text": "\"url\": \"https://github.com/facebook/react\" }, \"dependencies\": { <del> \"commoner\": \"~0.8.14\", </del> <ins> \"commoner\": \"~0.9.0\", </ins> \"esprima-fb\": \"~2001.1001.0-dev-harmony-fb\", \"jstransform\": \"~2.0.2\" },", "commid": "react_pr_981"}], "negative_passages": []} | |
| {"query_id": "q-en-react-2e85d1c388630c3452189c0522bfd16aa31ba5acfb33e1603d41a69c902342c4", "query": "After upgrading from React 0.10 to 0.11 our handler fires during server-side rendering and ends up in which requires access to the DOM, i.e. : Redacted stack trace:\nI have the same problem\nI'm having the same problem. I was so happy to see you finally the hrefLang attribute support and tried to upgrade immediately. Unfortunately this problem is keeping me from upgrading.\nFYI, we worked around it by using which might work in your case too depending on your use case.\nWow this sounds like a big regression. Can you construct a simple repro case?\nI will try but I probably won\u2019t be able to until Sunday the earliest. Frankly, the error doesn\u2019t happen with for every handler we have, so there might be something we\u2019re doing wrong.\nThis might happen always if you setState within a componentWillMount? Agree that we need to fix this.\nFor me it happens when I do setState in componentWillMount. Will try to come up with the simplest repro case.\nOh, setState() is probably going through ReactUpdates which is using the (browser-specific as of 0.11) ReactReconcileTransaction I think.\nYes, we are using in the failing handler. Is that a bad practice?\nmaybe? why are you doing that vs ?\nHere\u2019s the part of the stack trace ( is the offending handler):\nThis is the most simple example that reproduces the problem:\nTrying to figure out if the right move is to fix in or instead forbid in in favor of . Thoughts\nThe former; we've always said this is supported.\nbut why do we support it? seems like \"more than one way to do it\"...\nOne use case is computing something based on props in both componentWillMount and componentWillReceiveProps; you can make a helper and call it in both places.\ndoes the same thing, no?\nBased on your example, I can see now that calling is not very elegant in but disallowing it but would be a breaking change based on the current documentation: I\u2019m ok with a breaking change in releases as long as it\u2019s documented \u00e0 la change.\nWe're going to put out 0.11.1 with this (and a couple other ride-alongs). Thanks for bringing it to our attention!\n:+1: Thanks :smile:\nHi guys! The issue referenced above looks (reactjs/react-rails) related to this one... input welcome!", "positive_passages": [{"docid": "doc-en-react-86fa3b086bf47779ea8ba228dbf7f456a53f187ff313c418f4b2489d7df5dac8", "text": "var mocks = require('mocks'); <ins> var ExecutionEnvironment; </ins> var React; <ins> var ReactMarkupChecksum; </ins> var ReactMount; <ins> var ReactReconcileTransaction; </ins> var ReactTestUtils; var ReactServerRendering; <del> var ReactMarkupChecksum; var ExecutionEnvironment; </del> var ID_ATTRIBUTE_NAME;", "commid": "react_pr_1870"}], "negative_passages": []} | |
| {"query_id": "q-en-react-2e85d1c388630c3452189c0522bfd16aa31ba5acfb33e1603d41a69c902342c4", "query": "After upgrading from React 0.10 to 0.11 our handler fires during server-side rendering and ends up in which requires access to the DOM, i.e. : Redacted stack trace:\nI have the same problem\nI'm having the same problem. I was so happy to see you finally the hrefLang attribute support and tried to upgrade immediately. Unfortunately this problem is keeping me from upgrading.\nFYI, we worked around it by using which might work in your case too depending on your use case.\nWow this sounds like a big regression. Can you construct a simple repro case?\nI will try but I probably won\u2019t be able to until Sunday the earliest. Frankly, the error doesn\u2019t happen with for every handler we have, so there might be something we\u2019re doing wrong.\nThis might happen always if you setState within a componentWillMount? Agree that we need to fix this.\nFor me it happens when I do setState in componentWillMount. Will try to come up with the simplest repro case.\nOh, setState() is probably going through ReactUpdates which is using the (browser-specific as of 0.11) ReactReconcileTransaction I think.\nYes, we are using in the failing handler. Is that a bad practice?\nmaybe? why are you doing that vs ?\nHere\u2019s the part of the stack trace ( is the offending handler):\nThis is the most simple example that reproduces the problem:\nTrying to figure out if the right move is to fix in or instead forbid in in favor of . Thoughts\nThe former; we've always said this is supported.\nbut why do we support it? seems like \"more than one way to do it\"...\nOne use case is computing something based on props in both componentWillMount and componentWillReceiveProps; you can make a helper and call it in both places.\ndoes the same thing, no?\nBased on your example, I can see now that calling is not very elegant in but disallowing it but would be a breaking change based on the current documentation: I\u2019m ok with a breaking change in releases as long as it\u2019s documented \u00e0 la change.\nWe're going to put out 0.11.1 with this (and a couple other ride-alongs). Thanks for bringing it to our attention!\n:+1: Thanks :smile:\nHi guys! The issue referenced above looks (reactjs/react-rails) related to this one... input welcome!", "positive_passages": [{"docid": "doc-en-react-8c6664b9dd18238c386e8388cca596d050fb9e678aa76b4b382edadcadedbbca", "text": "beforeEach(function() { require('mock-modules').dumpCache(); React = require('React'); <ins> ReactMarkupChecksum = require('ReactMarkupChecksum'); </ins> ReactMount = require('ReactMount'); ReactTestUtils = require('ReactTestUtils'); <ins> ReactReconcileTransaction = require('ReactReconcileTransaction'); </ins> ExecutionEnvironment = require('ExecutionEnvironment'); ExecutionEnvironment.canUseDOM = false; ReactServerRendering = require('ReactServerRendering'); <del> ReactMarkupChecksum = require('ReactMarkupChecksum'); </del> var DOMProperty = require('DOMProperty'); ID_ATTRIBUTE_NAME = DOMProperty.ID_ATTRIBUTE_NAME;", "commid": "react_pr_1870"}], "negative_passages": []} | |
| {"query_id": "q-en-react-2e85d1c388630c3452189c0522bfd16aa31ba5acfb33e1603d41a69c902342c4", "query": "After upgrading from React 0.10 to 0.11 our handler fires during server-side rendering and ends up in which requires access to the DOM, i.e. : Redacted stack trace:\nI have the same problem\nI'm having the same problem. I was so happy to see you finally the hrefLang attribute support and tried to upgrade immediately. Unfortunately this problem is keeping me from upgrading.\nFYI, we worked around it by using which might work in your case too depending on your use case.\nWow this sounds like a big regression. Can you construct a simple repro case?\nI will try but I probably won\u2019t be able to until Sunday the earliest. Frankly, the error doesn\u2019t happen with for every handler we have, so there might be something we\u2019re doing wrong.\nThis might happen always if you setState within a componentWillMount? Agree that we need to fix this.\nFor me it happens when I do setState in componentWillMount. Will try to come up with the simplest repro case.\nOh, setState() is probably going through ReactUpdates which is using the (browser-specific as of 0.11) ReactReconcileTransaction I think.\nYes, we are using in the failing handler. Is that a bad practice?\nmaybe? why are you doing that vs ?\nHere\u2019s the part of the stack trace ( is the offending handler):\nThis is the most simple example that reproduces the problem:\nTrying to figure out if the right move is to fix in or instead forbid in in favor of . Thoughts\nThe former; we've always said this is supported.\nbut why do we support it? seems like \"more than one way to do it\"...\nOne use case is computing something based on props in both componentWillMount and componentWillReceiveProps; you can make a helper and call it in both places.\ndoes the same thing, no?\nBased on your example, I can see now that calling is not very elegant in but disallowing it but would be a breaking change based on the current documentation: I\u2019m ok with a breaking change in releases as long as it\u2019s documented \u00e0 la change.\nWe're going to put out 0.11.1 with this (and a couple other ride-alongs). Thanks for bringing it to our attention!\n:+1: Thanks :smile:\nHi guys! The issue referenced above looks (reactjs/react-rails) related to this one... input welcome!", "positive_passages": [{"docid": "doc-en-react-e4c9f26c4e027620bdc25234dd0ae617a2ff1a3f0a3e30f84a9348766a1ebba4", "text": "'a valid ReactComponent.' ); }); <ins> it('allows setState in componentWillMount without using DOM', function() { var Component = React.createClass({ componentWillMount: function() { this.setState({text: 'hello, world'}); }, render: function() { return <div>{this.state.text}</div>; } }); ReactReconcileTransaction.prototype.perform = function() { // We shouldn't ever be calling this on the server throw new Error('Browser reconcile transaction should not be used'); }; var markup = ReactServerRendering.renderComponentToString( <Component /> ); expect(markup.indexOf('hello, world') >= 0).toBe(true); }); </ins> }); });", "commid": "react_pr_1870"}], "negative_passages": []} | |
| {"query_id": "q-en-react-2e85d1c388630c3452189c0522bfd16aa31ba5acfb33e1603d41a69c902342c4", "query": "After upgrading from React 0.10 to 0.11 our handler fires during server-side rendering and ends up in which requires access to the DOM, i.e. : Redacted stack trace:\nI have the same problem\nI'm having the same problem. I was so happy to see you finally the hrefLang attribute support and tried to upgrade immediately. Unfortunately this problem is keeping me from upgrading.\nFYI, we worked around it by using which might work in your case too depending on your use case.\nWow this sounds like a big regression. Can you construct a simple repro case?\nI will try but I probably won\u2019t be able to until Sunday the earliest. Frankly, the error doesn\u2019t happen with for every handler we have, so there might be something we\u2019re doing wrong.\nThis might happen always if you setState within a componentWillMount? Agree that we need to fix this.\nFor me it happens when I do setState in componentWillMount. Will try to come up with the simplest repro case.\nOh, setState() is probably going through ReactUpdates which is using the (browser-specific as of 0.11) ReactReconcileTransaction I think.\nYes, we are using in the failing handler. Is that a bad practice?\nmaybe? why are you doing that vs ?\nHere\u2019s the part of the stack trace ( is the offending handler):\nThis is the most simple example that reproduces the problem:\nTrying to figure out if the right move is to fix in or instead forbid in in favor of . Thoughts\nThe former; we've always said this is supported.\nbut why do we support it? seems like \"more than one way to do it\"...\nOne use case is computing something based on props in both componentWillMount and componentWillReceiveProps; you can make a helper and call it in both places.\ndoes the same thing, no?\nBased on your example, I can see now that calling is not very elegant in but disallowing it but would be a breaking change based on the current documentation: I\u2019m ok with a breaking change in releases as long as it\u2019s documented \u00e0 la change.\nWe're going to put out 0.11.1 with this (and a couple other ride-alongs). Thanks for bringing it to our attention!\n:+1: Thanks :smile:\nHi guys! The issue referenced above looks (reactjs/react-rails) related to this one... input welcome!", "positive_passages": [{"docid": "doc-en-react-6c7a2ea2f7d9ce914e550371efb098fce8d41bd239c8399a12042b1d80379459", "text": "// componentDidUpdate) but we need to check here too in order to catch // updates enqueued by setState callbacks. while (dirtyComponents.length) { <ins> var allUnmounted = true; for (var i = 0, l = dirtyComponents.length; i < l; i++) { if (dirtyComponents[i].isMounted()) { allUnmounted = false; break; } } if (allUnmounted) { // All the \"dirty\" components are unmounted, which probably means that // they were marked dirty due to setState calls in componentWillMount // handlers and the components are currently in the process of mounting. // `runBatchedUpdates` will be a noop. In that case, initializing the // DOM-dependent ReactReconcileTransaction is thus not what we want to // do, especially when using server rendering, so we skip it. dirtyComponents.length = 0; return; } </ins> var transaction = ReactUpdatesFlushTransaction.getPooled(); transaction.perform(runBatchedUpdates, null, transaction); ReactUpdatesFlushTransaction.release(transaction);", "commid": "react_pr_1870"}], "negative_passages": []} | |
| {"query_id": "q-en-react-1e38296c0b68c1189567645d4bee40dd42c6efa1fd20400a01c82d0a5ffab32c", "query": "At the end, there is a confusing explanation about \"Duplicated data from props\" in the section \"What Shouldn\u2019t Go in State?\": Perhaps what is trying to be said is something like:\nAh, perhaps what they're really referring to is basically \"edit pages\", where you might want to diff the before and after, so that you can send only the changed variables. But it really reads quite weirdly, especially for beginners.\nThis change is needed. I'm new to React and just did a Google search on that part of the documentation for clarification and it came up with this page. I'm guessing that what you've interpreted it to mean is correct, as it makes sense that way.", "positive_passages": [{"docid": "doc-en-react-da82db36cff2f8fd8a79f4f349eaa280e9ab783ad80f56092dd2a24e1dac0c82", "text": "* **Computed data:** Don't worry about precomputing values based on state \u2014 it's easier to ensure that your UI is consistent if you do all computation within `render()`. For example, if you have an array of list items in state and you want to render the count as a string, simply render `this.state.listItems.length + ' list items'` in your `render()` method rather than storing it on state. * **React components:** Build them in `render()` based on underlying props and state. <del> * **Duplicated data from props:** Try to use props as the source of truth where possible. Because props can change over time, it's appropriate to store props in state to be able to know its previous values. </del> <ins> * **Duplicated data from props:** Try to use props as the source of truth where possible. One valid use to store props in state is to be able to know it's previous values, because props can change over time. </ins>", "commid": "react_pr_2635"}], "negative_passages": []} | |
| {"query_id": "q-en-react-d933a6e06b1d6c49d61d5e7b815e1e0cc110275a21e1ed9185bb07dc14989eab", "query": "Understandably general given that this is used to merge a couple things, but the actual use case is when or (or but shh) is used in a mixin and the component and both return an object with the same key. We should make this error mention something about those methods so people have an idea of where to look instead of them coming to IRC and being (rightfully) confused.", "positive_passages": [{"docid": "doc-en-react-e4f795e1235ca92806e674ac5b38f4fc9f8c66b295cbefb2ad5b77e4d6552175", "text": "invariant( one[key] === undefined, 'mergeObjectsWithNoDuplicateKeys(): ' + <del> 'Tried to merge two objects with the same key: %s', </del> <ins> 'Tried to merge two objects with the same key: `%s`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.', </ins> key ); one[key] = value;", "commid": "react_pr_2037"}], "negative_passages": []} | |
| {"query_id": "q-en-react-d933a6e06b1d6c49d61d5e7b815e1e0cc110275a21e1ed9185bb07dc14989eab", "query": "Understandably general given that this is used to merge a couple things, but the actual use case is when or (or but shh) is used in a mixin and the component and both return an object with the same key. We should make this error mention something about those methods so people have an idea of where to look instead of them coming to IRC and being (rightfully) confused.", "positive_passages": [{"docid": "doc-en-react-4134d81734458406d3b456b46dcc61bd82b5668ca375b3bf775b2c2bb168855a", "text": "instance = ReactTestUtils.renderIntoDocument(instance); }).toThrow( 'Invariant Violation: mergeObjectsWithNoDuplicateKeys(): ' + <del> 'Tried to merge two objects with the same key: x' </del> <ins> 'Tried to merge two objects with the same key: `x`. This conflict ' + 'may be due to a mixin; in particular, this may be caused by two ' + 'getInitialState() or getDefaultProps() methods returning objects ' + 'with clashing keys.' </ins> ); });", "commid": "react_pr_2037"}], "negative_passages": []} | |
| {"query_id": "q-en-react-5b07e7e228a24761e0570be670d9936d76e2b49a3d985ee42dfc361ae0dea954", "query": "Without , is , which causes this line in to throw. Fix is to make shallowEqual bail if either argument is falsey (or not an object if we want to be very safe).\nIs this with PureRenderMixin?\nYes, I meant to link to the jsbin: ,js,console,output I'm putting together a PR now.\nIt is potentially worth noting that getInitialState is likely to become required for stateful components in the near future. See It is already the case that any component calling should ideally be specifying a .\nI definitely think it makes sense to make required for stateful components +1", "positive_passages": [{"docid": "doc-en-react-d664c9c45770d6e9f28a6f5e6e8e0d6090c2c2e680103ebecfb53a558305bce9", "text": "<ins> /** * Copyright 2014-2015, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @emails react-core */ 'use strict'; require('mock-modules') .dontMock('shallowEqual'); var shallowEqual; describe('shallowEqual', function() { beforeEach(function() { shallowEqual = require('shallowEqual'); }); it('returns false if either argument is null', function() { expect(shallowEqual(null, {})).toBe(false); expect(shallowEqual({}, null)).toBe(false); }); it('returns true if both arguments are null or undefined', function() { expect(shallowEqual(null, null)).toBe(true); expect(shallowEqual(undefined, undefined)).toBe(true); }); it('returns true if arguments are shallow equal', function() { expect( shallowEqual( {a: 1, b: 2, c: 3}, {a: 1, b: 2, c: 3} ) ).toBe(true); }); it('returns false if first argument has too many keys', function() { expect( shallowEqual( {a: 1, b: 2, c: 3}, {a: 1, b: 2} ) ).toBe(false); }); it('returns false if second argument has too many keys', function() { expect( shallowEqual( {a: 1, b: 2}, {a: 1, b: 2, c: 3} ) ).toBe(false); }); it('returns false if arguments are not shallow equal', function() { expect( shallowEqual( {a: 1, b: 2, c: {}}, {a: 1, b: 2, c: {}} ) ).toBe(false); }); }); </ins>", "commid": "react_pr_3317"}], "negative_passages": []} | |
| {"query_id": "q-en-react-5b07e7e228a24761e0570be670d9936d76e2b49a3d985ee42dfc361ae0dea954", "query": "Without , is , which causes this line in to throw. Fix is to make shallowEqual bail if either argument is falsey (or not an object if we want to be very safe).\nIs this with PureRenderMixin?\nYes, I meant to link to the jsbin: ,js,console,output I'm putting together a PR now.\nIt is potentially worth noting that getInitialState is likely to become required for stateful components in the near future. See It is already the case that any component calling should ideally be specifying a .\nI definitely think it makes sense to make required for stateful components +1", "positive_passages": [{"docid": "doc-en-react-8f0f6eb1846a5dbcf8f6f26b72dbb7162700a5dbaaede96d44f06a563947b22e", "text": "if (objA === objB) { return true; } <ins> if (!objA || !objB) { return false; } </ins> var key; // Test for A's keys different from B. for (key in objA) {", "commid": "react_pr_3317"}], "negative_passages": []} | |
| {"query_id": "q-en-react-992788d04eacfdbd9f7506fb810dc3b3a874dac91bdb786726dd5919742f52ba", "query": "! Edits were made last week to this page, maybe it was broken accidentally?\nI guess you use https, but the page loads a script over http and that gets blocked. I made a pull request to fix this . I couldn't test it, so fingers crossed that it is right.\nI though we were going to remove this page and let this live entirely in the react-magic repo?\nThe scripts live in the react-magic repo, but I think we'll keep the page on the React site as it's still really useful there.", "positive_passages": [{"docid": "doc-en-react-89f6ad41bb608aa76e5bfa8a414adf2c3657357b5cf38c787f2ac010ca54b5d1", "text": "<div class=\"jsxCompiler\"> <h1>HTML to JSX Compiler</h1> <div id=\"jsxCompiler\"></div> <del> <script src=\"http://reactjs.github.io/react-magic/htmltojsx.min.js\"></script> </del> <ins> <script src=\"https://reactjs.github.io/react-magic/htmltojsx.min.js\"></script> </ins> <script src=\"js/html-jsx.js\"></script> </div>", "commid": "react_pr_3456"}], "negative_passages": []} | |
| {"query_id": "q-en-react-7cee673c705e9cb697230b43b33291930010f626755df2cfe00d278bf0bb75f4", "query": "Idea (that I'm pretty sure I saw elsewhere, react-native maybe?)\u2026 We should transform our calls to a conditional wrapping the call. We have to check the condition anyway and this would reduce the no-op function calls. In otherwords becomes Hell, we could replace the with and get rid of the function call entirely, though it really doesn't matter much since we're going to throw (plus we'd duplicate the default string). This might end up be a meaningless optimization\u2026\nI believe this is done intentionally (by hand) in some hotspots, so it would seem not. I guess one could argue if it might not make more sense to simply always use the inline style and drop the argument rather than adding another transform?\nThat's a tough sentence to parse. Are you saying we should always write the \"optimized\" form? If so I would say \"no\", the first is way easier to read as a human being.\ndo you consider something like since jsx has to be transformed anyways? invariant feels more like a contract to me and codes could be more readable if we separate the warning and real implementation, any thoughts?\nWe have complex invariants that aren't strictly about arguments so while that might be an option for some cases, it doesn't cover us.", "positive_passages": [{"docid": "doc-en-react-3f4c65c191b8b02a4ff276369801d4c4ada1f6a7904f8a9548b5f851a2dfc433", "text": "}, \"preferGlobal\": true, \"commonerConfig\": { <del> \"version\": 6 </del> <ins> \"version\": 7 </ins> }, \"scripts\": { \"test\": \"jest\",", "commid": "react_pr_3788"}], "negative_passages": []} | |
| {"query_id": "q-en-react-7cee673c705e9cb697230b43b33291930010f626755df2cfe00d278bf0bb75f4", "query": "Idea (that I'm pretty sure I saw elsewhere, react-native maybe?)\u2026 We should transform our calls to a conditional wrapping the call. We have to check the condition anyway and this would reduce the no-op function calls. In otherwords becomes Hell, we could replace the with and get rid of the function call entirely, though it really doesn't matter much since we're going to throw (plus we'd duplicate the default string). This might end up be a meaningless optimization\u2026\nI believe this is done intentionally (by hand) in some hotspots, so it would seem not. I guess one could argue if it might not make more sense to simply always use the inline style and drop the argument rather than adding another transform?\nThat's a tough sentence to parse. Are you saying we should always write the \"optimized\" form? If so I would say \"no\", the first is way easier to read as a human being.\ndo you consider something like since jsx has to be transformed anyways? invariant feels more like a contract to me and codes could be more readable if we separate the warning and real implementation, any thoughts?\nWe have complex invariants that aren't strictly about arguments so while that might be an option for some cases, it doesn't cover us.", "positive_passages": [{"docid": "doc-en-react-9cff522cafc943cbeed3a28cfd651ce73b7407f275a210ecd0e90ca2f666690d", "text": "CallExpression: { exit: function(node, parent) { if (this.get('callee').isIdentifier({name: 'invariant'})) { <del> // Truncate the arguments of invariant(condition, ...) // statements to just the condition based on NODE_ENV // (dead code removal will remove the extra bytes). return t.conditionalExpression( DEV_EXPRESSION, node, t.callExpression(node.callee, [node.arguments[0]]) </del> <ins> // Turns this code: // // invariant(condition, argument, argument); // // into this: // // if (!condition) { // if (\"production\" !== process.env.NODE_ENV) { // invariant(false, argument, argument); // } else { // invariant(false); // } // } // // Specifically this does 2 things: // 1. Checks the condition first, preventing an extra function call. // 2. Adds an environment check so that verbose error messages aren't // shipped to production. // The generated code is longer than the original code but will dead // code removal in a minifier will strip that out. var condition = node.arguments[0]; return t.ifStatement( t.unaryExpression('!', condition), t.blockStatement([ t.ifStatement( DEV_EXPRESSION, t.blockStatement([ t.expressionStatement( t.callExpression( node.callee, [t.literal(false)].concat(node.arguments.slice(1)) ) ) ]), t.blockStatement([ t.expressionStatement( t.callExpression( node.callee, [t.literal(false)] ) ) ]) ) ]) </ins> ); } else if (this.get('callee').isIdentifier({name: 'warning'})) { <del> // Eliminate warning(condition, ...) statements based on NODE_ENV // (dead code removal will remove the extra bytes). return t.conditionalExpression( </del> <ins> // Turns this code: // // warning(condition, argument, argument); // // into this: // // if (\"production\" !== process.env.NODE_ENV) { // warning(condition, argument, argument); // } // // The goal is to strip out warning calls entirely in production. We // don't need the same optimizations for conditions that we use for // invariant because we don't care about an extra call in __DEV__ return t.ifStatement( </ins> DEV_EXPRESSION, <del> node, t.literal(null) </del> <ins> t.blockStatement([ t.expressionStatement( node ) ]) </ins> ); } }", "commid": "react_pr_3788"}], "negative_passages": []} | |
| {"query_id": "q-en-react-54060f4545d63feb8aaa8bc412f08b9ea7936de5654c8d3915d95c8d7cf6e21a", "query": "The attribute allows for restrictions to be placed on iframes, regardless of domain. It's useful if you're dealing with IE versions less than 10 that don't have the attribute. More info: (v=vs.85).aspx", "positive_passages": [{"docid": "doc-en-react-69f17fa4a4ca876f149eff2e205fb59cf86381a6afa0e1fea6f3478d2fb2390f", "text": "itemRef: MUST_USE_ATTRIBUTE, // property is supported for OpenGraph in meta tags. property: null, <ins> // IE-only attribute that specifies security restrictions on an iframe // as an alternative to the sandbox attribute on IE<10 security: MUST_USE_ATTRIBUTE, </ins> // IE-only attribute that controls focus behavior unselectable: MUST_USE_ATTRIBUTE, },", "commid": "react_pr_4259"}], "negative_passages": []} | |
| {"query_id": "q-en-react-2918d4cceab6c3c8e094d830449f23084d5937cfc7c9c1597de5544182b7ff3e", "query": "Do you want to request a feature or report a bug? It's more of a bug -- I don't think this behaviour should occur, but it's not a problem in production. What is the current behavior? Warning appears. If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via or similar (template: ). . I'll paste the code here too, just in case: What is the expected behavior? No warning. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Fiddle uses React 15.0.1. Tested in Chrome on Ubuntu. I didn't test previous versions of React, but I suspect it's always been this way. Notes If I'm not mistaken, the HTML generated via cannot be updated by React because the essential DOM attributes are stripped away. This means that s should not be necessary because React will never need to match up the elements during a re-render. Supplying s that will never be used just to avoid a warning is tedious. Ergo, warning should be suppressed when JSX is rendered via .\nYeah, technically true. There were some talks a while back about potentially doing , in which case, and could become a single function because React wouldn't need any additional data in the DOM. That would make this don't-emit-key-warning difference much harder to justify. There is also something to be said for remaining consistent. If you are writing components that don't specify a key, then your components can't be shared/used with nor in the future (decreases reusability, increases fragmentation). Maybe it would be too opinionated for us to enforce that, but I could make the argument that maintaining a single cohesive component ecosystem is more important. Honestly, this would be pretty low priority for us. If you see an easy fix and want to submit a PR, I'd say it has a 50/50 chance (coin toss) of getting merged, probably depending primarily on complexity. We don't want to introduce any global state or do a whole ton of routing to decide if this warning needs to be emitted. Probably your best bet would be to move the warning to a devtool, and have the devtool become aware of what type of render is being performed. Nested renders would need to be considered. I'm going to close this out because this isn't a clear win for us, and it is almost certainly something that our team would not have the bandwidth to do internally. If someone in the community is passionate about fixing this, we'd take a look at any PRs, but can't make any promises a priori.\nThat's fair enough, I wouldn't rate it as high priority either. Thank you for taking the time to respond", "positive_passages": [{"docid": "doc-en-react-08bc89b1e51d4ef0d40a57deb51584c975a2f17488c9822adc68361928a14afa", "text": "var grunt = require('grunt'); var UglifyJS = require('uglify-js'); var uglifyify = require('uglifyify'); <del> var _ = require('lodash'); </del> <ins> var derequire = require('derequire'); </ins> var SIMPLE_TEMPLATE = '/**n", "commid": "react_pr_2349"}], "negative_passages": []} | |
| {"query_id": "q-en-react-2918d4cceab6c3c8e094d830449f23084d5937cfc7c9c1597de5544182b7ff3e", "query": "Do you want to request a feature or report a bug? It's more of a bug -- I don't think this behaviour should occur, but it's not a problem in production. What is the current behavior? Warning appears. If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via or similar (template: ). . I'll paste the code here too, just in case: What is the expected behavior? No warning. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Fiddle uses React 15.0.1. Tested in Chrome on Ubuntu. I didn't test previous versions of React, but I suspect it's always been this way. Notes If I'm not mistaken, the HTML generated via cannot be updated by React because the essential DOM attributes are stripped away. This means that s should not be necessary because React will never need to match up the elements during a re-render. Supplying s that will never be used just to avoid a warning is tedious. Ergo, warning should be suppressed when JSX is rendered via .\nYeah, technically true. There were some talks a while back about potentially doing , in which case, and could become a single function because React wouldn't need any additional data in the DOM. That would make this don't-emit-key-warning difference much harder to justify. There is also something to be said for remaining consistent. If you are writing components that don't specify a key, then your components can't be shared/used with nor in the future (decreases reusability, increases fragmentation). Maybe it would be too opinionated for us to enforce that, but I could make the argument that maintaining a single cohesive component ecosystem is more important. Honestly, this would be pretty low priority for us. If you see an easy fix and want to submit a PR, I'd say it has a 50/50 chance (coin toss) of getting merged, probably depending primarily on complexity. We don't want to introduce any global state or do a whole ton of routing to decide if this warning needs to be emitted. Probably your best bet would be to move the warning to a devtool, and have the devtool become aware of what type of render is being performed. Nested renders would need to be considered. I'm going to close this out because this isn't a clear win for us, and it is almost certainly something that our team would not have the bandwidth to do internally. If someone in the community is passionate about fixing this, we'd take a look at any PRs, but can't make any promises a priori.\nThat's fair enough, I wouldn't rate it as high priority either. Thank you for taking the time to respond", "positive_passages": [{"docid": "doc-en-react-d52c72945ab19ca557aaebddc9dfab2323690da98f8da9304cc0e00fd6fd23c5", "text": "debug: false, standalone: 'React', transforms: [envify({NODE_ENV: 'development'})], <del> after: [es3ify.transform, simpleBannerify] </del> <ins> after: [es3ify.transform, derequire, simpleBannerify] </ins> }; <del> var min = _.merge({}, basic, { </del> <ins> var min = { entries: [ './build/modules/React.js' ], </ins> outfile: './build/react.min.js', debug: false, <ins> standalone: 'React', </ins> transforms: [envify({NODE_ENV: 'production'}), uglifyify], <del> after: [minify, bannerify] }); </del> <ins> after: [es3ify.transform, derequire, minify, bannerify] }; </ins> var transformer = { entries:[", "commid": "react_pr_2349"}], "negative_passages": []} | |
| {"query_id": "q-en-react-2918d4cceab6c3c8e094d830449f23084d5937cfc7c9c1597de5544182b7ff3e", "query": "Do you want to request a feature or report a bug? It's more of a bug -- I don't think this behaviour should occur, but it's not a problem in production. What is the current behavior? Warning appears. If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via or similar (template: ). . I'll paste the code here too, just in case: What is the expected behavior? No warning. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Fiddle uses React 15.0.1. Tested in Chrome on Ubuntu. I didn't test previous versions of React, but I suspect it's always been this way. Notes If I'm not mistaken, the HTML generated via cannot be updated by React because the essential DOM attributes are stripped away. This means that s should not be necessary because React will never need to match up the elements during a re-render. Supplying s that will never be used just to avoid a warning is tedious. Ergo, warning should be suppressed when JSX is rendered via .\nYeah, technically true. There were some talks a while back about potentially doing , in which case, and could become a single function because React wouldn't need any additional data in the DOM. That would make this don't-emit-key-warning difference much harder to justify. There is also something to be said for remaining consistent. If you are writing components that don't specify a key, then your components can't be shared/used with nor in the future (decreases reusability, increases fragmentation). Maybe it would be too opinionated for us to enforce that, but I could make the argument that maintaining a single cohesive component ecosystem is more important. Honestly, this would be pretty low priority for us. If you see an easy fix and want to submit a PR, I'd say it has a 50/50 chance (coin toss) of getting merged, probably depending primarily on complexity. We don't want to introduce any global state or do a whole ton of routing to decide if this warning needs to be emitted. Probably your best bet would be to move the warning to a devtool, and have the devtool become aware of what type of render is being performed. Nested renders would need to be considered. I'm going to close this out because this isn't a clear win for us, and it is almost certainly something that our team would not have the bandwidth to do internally. If someone in the community is passionate about fixing this, we'd take a look at any PRs, but can't make any promises a priori.\nThat's fair enough, I wouldn't rate it as high priority either. Thank you for taking the time to respond", "positive_passages": [{"docid": "doc-en-react-ff0daa58a7b1906f42412d89c6f4adfd92319da60311baee5da7a22d8bcb9fe9", "text": "outfile: './build/JSXTransformer.js', debug: false, standalone: 'JSXTransformer', <del> after: [es3ify.transform, simpleBannerify] </del> <ins> transforms: [], after: [es3ify.transform, derequire, simpleBannerify] </ins> }; var addons = {", "commid": "react_pr_2349"}], "negative_passages": []} | |
| {"query_id": "q-en-react-2918d4cceab6c3c8e094d830449f23084d5937cfc7c9c1597de5544182b7ff3e", "query": "Do you want to request a feature or report a bug? It's more of a bug -- I don't think this behaviour should occur, but it's not a problem in production. What is the current behavior? Warning appears. If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via or similar (template: ). . I'll paste the code here too, just in case: What is the expected behavior? No warning. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Fiddle uses React 15.0.1. Tested in Chrome on Ubuntu. I didn't test previous versions of React, but I suspect it's always been this way. Notes If I'm not mistaken, the HTML generated via cannot be updated by React because the essential DOM attributes are stripped away. This means that s should not be necessary because React will never need to match up the elements during a re-render. Supplying s that will never be used just to avoid a warning is tedious. Ergo, warning should be suppressed when JSX is rendered via .\nYeah, technically true. There were some talks a while back about potentially doing , in which case, and could become a single function because React wouldn't need any additional data in the DOM. That would make this don't-emit-key-warning difference much harder to justify. There is also something to be said for remaining consistent. If you are writing components that don't specify a key, then your components can't be shared/used with nor in the future (decreases reusability, increases fragmentation). Maybe it would be too opinionated for us to enforce that, but I could make the argument that maintaining a single cohesive component ecosystem is more important. Honestly, this would be pretty low priority for us. If you see an easy fix and want to submit a PR, I'd say it has a 50/50 chance (coin toss) of getting merged, probably depending primarily on complexity. We don't want to introduce any global state or do a whole ton of routing to decide if this warning needs to be emitted. Probably your best bet would be to move the warning to a devtool, and have the devtool become aware of what type of render is being performed. Nested renders would need to be considered. I'm going to close this out because this isn't a clear win for us, and it is almost certainly something that our team would not have the bandwidth to do internally. If someone in the community is passionate about fixing this, we'd take a look at any PRs, but can't make any promises a priori.\nThat's fair enough, I wouldn't rate it as high priority either. Thank you for taking the time to respond", "positive_passages": [{"docid": "doc-en-react-fb7f6dd4afda24ec875e2e96f5030cb142ef02c10cd809825e25368a0b818104", "text": "outfile: './build/react-with-addons.js', debug: false, standalone: 'React', <del> transforms: [envify({NODE_ENV: 'development'})], </del> packageName: 'React (with addons)', <del> after: [es3ify.transform, simpleBannerify] </del> <ins> transforms: [envify({NODE_ENV: 'development'})], after: [es3ify.transform, derequire, simpleBannerify] </ins> }; <del> var addonsMin = _.merge({}, addons, { </del> <ins> var addonsMin = { entries: [ './build/modules/ReactWithAddons.js' ], </ins> outfile: './build/react-with-addons.min.js', debug: false, <ins> standalone: 'React', packageName: 'React (with addons)', </ins> transforms: [envify({NODE_ENV: 'production'}), uglifyify], <del> after: [minify, bannerify] }); </del> <ins> after: [es3ify.transform, derequire, minify, bannerify] }; </ins> var withCodeCoverageLogging = { entries: [", "commid": "react_pr_2349"}], "negative_passages": []} | |
| {"query_id": "q-en-react-2918d4cceab6c3c8e094d830449f23084d5937cfc7c9c1597de5544182b7ff3e", "query": "Do you want to request a feature or report a bug? It's more of a bug -- I don't think this behaviour should occur, but it's not a problem in production. What is the current behavior? Warning appears. If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via or similar (template: ). . I'll paste the code here too, just in case: What is the expected behavior? No warning. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Fiddle uses React 15.0.1. Tested in Chrome on Ubuntu. I didn't test previous versions of React, but I suspect it's always been this way. Notes If I'm not mistaken, the HTML generated via cannot be updated by React because the essential DOM attributes are stripped away. This means that s should not be necessary because React will never need to match up the elements during a re-render. Supplying s that will never be used just to avoid a warning is tedious. Ergo, warning should be suppressed when JSX is rendered via .\nYeah, technically true. There were some talks a while back about potentially doing , in which case, and could become a single function because React wouldn't need any additional data in the DOM. That would make this don't-emit-key-warning difference much harder to justify. There is also something to be said for remaining consistent. If you are writing components that don't specify a key, then your components can't be shared/used with nor in the future (decreases reusability, increases fragmentation). Maybe it would be too opinionated for us to enforce that, but I could make the argument that maintaining a single cohesive component ecosystem is more important. Honestly, this would be pretty low priority for us. If you see an easy fix and want to submit a PR, I'd say it has a 50/50 chance (coin toss) of getting merged, probably depending primarily on complexity. We don't want to introduce any global state or do a whole ton of routing to decide if this warning needs to be emitted. Probably your best bet would be to move the warning to a devtool, and have the devtool become aware of what type of render is being performed. Nested renders would need to be considered. I'm going to close this out because this isn't a clear win for us, and it is almost certainly something that our team would not have the bandwidth to do internally. If someone in the community is passionate about fixing this, we'd take a look at any PRs, but can't make any promises a priori.\nThat's fair enough, I wouldn't rate it as high priority either. Thank you for taking the time to respond", "positive_passages": [{"docid": "doc-en-react-97c41f5b1ea82b3a1bb345a546f5031a115d6555d867f2fde16f6c3e260fa207", "text": "// grunt.config.requires('entries'); config.transforms = config.transforms || []; config.after = config.after || []; <del> if (typeof config.after === 'function') { config.after = [config.after]; } </del> // create the bundle we'll work with var entries = grunt.file.expand(config.entries); <del> var bundle = browserify(entries); // Make sure the things that need to be exposed are. var requires = config.requires || {}; if (requires instanceof Array) { grunt.file.expand({ nonull: true, // Keep IDs that don't expand to anything. cwd: \"src\" }, requires).forEach(function(name) { bundle.require(\"./build/modules/\" + name, { expose: name.replace(/.js$/i, \"\") }); }); } else if (typeof requires === \"object\") { Object.keys(requires).forEach(function(name) { bundle.require(requires[name], { expose: name }); }); } </del> // Extract other options var options = { <ins> entries: entries, </ins> debug: config.debug, // sourcemaps standalone: config.standalone // global }; <del> // TODO: make sure this works, test with this too </del> <ins> var bundle = browserify(options); </ins> config.transforms.forEach(function(transform) { bundle.transform({}, transform); }); // Actually bundle it up var _this = this; <del> bundle.bundle(options, function(err, src) { </del> <ins> bundle.bundle(function(err, buf) { </ins> if (err) { grunt.log.error(err); <del> done(); </del> <ins> return done(); </ins> } <ins> var src = buf.toString(); </ins> config.after.forEach(function(fn) { src = fn.call(_this, src); });", "commid": "react_pr_2349"}], "negative_passages": []} | |
| {"query_id": "q-en-react-2918d4cceab6c3c8e094d830449f23084d5937cfc7c9c1597de5544182b7ff3e", "query": "Do you want to request a feature or report a bug? It's more of a bug -- I don't think this behaviour should occur, but it's not a problem in production. What is the current behavior? Warning appears. If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via or similar (template: ). . I'll paste the code here too, just in case: What is the expected behavior? No warning. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Fiddle uses React 15.0.1. Tested in Chrome on Ubuntu. I didn't test previous versions of React, but I suspect it's always been this way. Notes If I'm not mistaken, the HTML generated via cannot be updated by React because the essential DOM attributes are stripped away. This means that s should not be necessary because React will never need to match up the elements during a re-render. Supplying s that will never be used just to avoid a warning is tedious. Ergo, warning should be suppressed when JSX is rendered via .\nYeah, technically true. There were some talks a while back about potentially doing , in which case, and could become a single function because React wouldn't need any additional data in the DOM. That would make this don't-emit-key-warning difference much harder to justify. There is also something to be said for remaining consistent. If you are writing components that don't specify a key, then your components can't be shared/used with nor in the future (decreases reusability, increases fragmentation). Maybe it would be too opinionated for us to enforce that, but I could make the argument that maintaining a single cohesive component ecosystem is more important. Honestly, this would be pretty low priority for us. If you see an easy fix and want to submit a PR, I'd say it has a 50/50 chance (coin toss) of getting merged, probably depending primarily on complexity. We don't want to introduce any global state or do a whole ton of routing to decide if this warning needs to be emitted. Probably your best bet would be to move the warning to a devtool, and have the devtool become aware of what type of render is being performed. Nested renders would need to be considered. I'm going to close this out because this isn't a clear win for us, and it is almost certainly something that our team would not have the bandwidth to do internally. If someone in the community is passionate about fixing this, we'd take a look at any PRs, but can't make any promises a priori.\nThat's fair enough, I wouldn't rate it as high priority either. Thank you for taking the time to respond", "positive_passages": [{"docid": "doc-en-react-20a3f441105be66fd78ec211100eab02ec2aa1e31b656574c5ce7fe08a35faa8", "text": "\"node\": \">=0.10.0\" }, \"dependencies\": { <del> \"envify\": \"^2.0.0\" </del> <ins> \"envify\": \"^3.0.0\" </ins> }, \"browserify\": { \"transform\": [\"envify\"]", "commid": "react_pr_2349"}], "negative_passages": []} | |
| {"query_id": "q-en-react-2918d4cceab6c3c8e094d830449f23084d5937cfc7c9c1597de5544182b7ff3e", "query": "Do you want to request a feature or report a bug? It's more of a bug -- I don't think this behaviour should occur, but it's not a problem in production. What is the current behavior? Warning appears. If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via or similar (template: ). . I'll paste the code here too, just in case: What is the expected behavior? No warning. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Fiddle uses React 15.0.1. Tested in Chrome on Ubuntu. I didn't test previous versions of React, but I suspect it's always been this way. Notes If I'm not mistaken, the HTML generated via cannot be updated by React because the essential DOM attributes are stripped away. This means that s should not be necessary because React will never need to match up the elements during a re-render. Supplying s that will never be used just to avoid a warning is tedious. Ergo, warning should be suppressed when JSX is rendered via .\nYeah, technically true. There were some talks a while back about potentially doing , in which case, and could become a single function because React wouldn't need any additional data in the DOM. That would make this don't-emit-key-warning difference much harder to justify. There is also something to be said for remaining consistent. If you are writing components that don't specify a key, then your components can't be shared/used with nor in the future (decreases reusability, increases fragmentation). Maybe it would be too opinionated for us to enforce that, but I could make the argument that maintaining a single cohesive component ecosystem is more important. Honestly, this would be pretty low priority for us. If you see an easy fix and want to submit a PR, I'd say it has a 50/50 chance (coin toss) of getting merged, probably depending primarily on complexity. We don't want to introduce any global state or do a whole ton of routing to decide if this warning needs to be emitted. Probably your best bet would be to move the warning to a devtool, and have the devtool become aware of what type of render is being performed. Nested renders would need to be considered. I'm going to close this out because this isn't a clear win for us, and it is almost certainly something that our team would not have the bandwidth to do internally. If someone in the community is passionate about fixing this, we'd take a look at any PRs, but can't make any promises a priori.\nThat's fair enough, I wouldn't rate it as high priority either. Thank you for taking the time to respond", "positive_passages": [{"docid": "doc-en-react-0c5f43a655ae4fa34f170aa69c147d6cef9d7c74a69573783eadc7807b0916e6", "text": "\"dependencies\": { \"commoner\": \"^0.10.0\", \"esprima-fb\": \"^6001.1.0-dev-harmony-fb\", <del> \"jstransform\": \"^6.2.0\" </del> <ins> \"jstransform\": \"^6.3.2\" </ins> }, \"devDependencies\": { \"benchmark\": \"~1.0.0\", <del> \"browserify\": \"^4.1.10\", </del> <ins> \"browserify\": \"^6.1.0\", </ins> \"coverify\": \"~1.0.4\", <del> \"envify\": \"^2.0.0\", </del> <ins> \"derequire\": \"^1.2.0\", \"envify\": \"^3.0.0\", </ins> \"es3ify\": \"~0.1.2\", \"es5-shim\": \"^4.0.0\", \"grunt\": \"~0.4.2\", \"grunt-cli\": \"~0.1.9\", \"grunt-compare-size\": \"~0.4.0\", <del> \"grunt-contrib-clean\": \"~0.5.0\", \"grunt-contrib-compress\": \"^0.9.1\", </del> <ins> \"grunt-contrib-clean\": \"^0.6.0\", \"grunt-contrib-compress\": \"^0.12.0\", </ins> \"grunt-contrib-connect\": \"~0.6.0\", <del> \"grunt-contrib-copy\": \"~0.5.0\", </del> <ins> \"grunt-contrib-copy\": \"^0.6.0\", </ins> \"grunt-contrib-jshint\": \"^0.10.0\", \"gzip-js\": \"~0.3.2\", \"jasmine-tapreporter\": \"~0.2.2\", \"jest-cli\": \"~0.1.5\", \"lodash\": \"~2.4.1\", <del> \"microtime\": \"^0.6.0\", </del> \"optimist\": \"~0.6.0\", \"phantomjs\": \"~1.9\", \"platform\": \"^1.1.0\", \"populist\": \"~0.1.6\", <del> \"recast\": \"^0.6.10\", </del> <ins> \"recast\": \"^0.7.2\", </ins> \"sauce-tunnel\": \"~1.1.0\", <del> \"semver\": \"^2.3.0\", </del> \"tmp\": \"~0.0.18\", \"uglify-js\": \"~2.4.0\", \"uglifyify\": \"^2.4.0\",", "commid": "react_pr_2349"}], "negative_passages": []} | |
| {"query_id": "q-en-react-2918d4cceab6c3c8e094d830449f23084d5937cfc7c9c1597de5544182b7ff3e", "query": "Do you want to request a feature or report a bug? It's more of a bug -- I don't think this behaviour should occur, but it's not a problem in production. What is the current behavior? Warning appears. If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via or similar (template: ). . I'll paste the code here too, just in case: What is the expected behavior? No warning. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Fiddle uses React 15.0.1. Tested in Chrome on Ubuntu. I didn't test previous versions of React, but I suspect it's always been this way. Notes If I'm not mistaken, the HTML generated via cannot be updated by React because the essential DOM attributes are stripped away. This means that s should not be necessary because React will never need to match up the elements during a re-render. Supplying s that will never be used just to avoid a warning is tedious. Ergo, warning should be suppressed when JSX is rendered via .\nYeah, technically true. There were some talks a while back about potentially doing , in which case, and could become a single function because React wouldn't need any additional data in the DOM. That would make this don't-emit-key-warning difference much harder to justify. There is also something to be said for remaining consistent. If you are writing components that don't specify a key, then your components can't be shared/used with nor in the future (decreases reusability, increases fragmentation). Maybe it would be too opinionated for us to enforce that, but I could make the argument that maintaining a single cohesive component ecosystem is more important. Honestly, this would be pretty low priority for us. If you see an easy fix and want to submit a PR, I'd say it has a 50/50 chance (coin toss) of getting merged, probably depending primarily on complexity. We don't want to introduce any global state or do a whole ton of routing to decide if this warning needs to be emitted. Probably your best bet would be to move the warning to a devtool, and have the devtool become aware of what type of render is being performed. Nested renders would need to be considered. I'm going to close this out because this isn't a clear win for us, and it is almost certainly something that our team would not have the bandwidth to do internally. If someone in the community is passionate about fixing this, we'd take a look at any PRs, but can't make any promises a priori.\nThat's fair enough, I wouldn't rate it as high priority either. Thank you for taking the time to respond", "positive_passages": [{"docid": "doc-en-react-55e128ceae5495a426e8609bd3eccbbbd5b9b75ba4fc2e168009852c6f813abd", "text": "\"rootDir\": \"\", \"scriptPreprocessor\": \"jest/preprocessor.js\", \"setupEnvScriptFile\": \"jest/environment.js\", <del> \"modulePathIgnorePatterns\": [\"/build/\", \"/node_modules/\", \"/.module-cache/\"], \"testPathIgnorePatterns\": [\"/build/\", \"/node_modules/\"], \"unmockedModulePathPatterns\": [\"\"] </del> <ins> \"modulePathIgnorePatterns\": [ \"/build/\", \"/node_modules/\", \"/.module-cache/\" ], \"testPathIgnorePatterns\": [ \"/build/\", \"/node_modules/\" ], \"unmockedModulePathPatterns\": [ \"\" ] </ins> } }", "commid": "react_pr_2349"}], "negative_passages": []} | |
| {"query_id": "q-en-react-59b37ca196152e1056c9078333143322d0e34f9ba58219e7e80121a48e0b7386", "query": "Do you want to request a feature or report a bug? Bug. What is the current behavior? Right now, React provides a cross-browser workaround for the event. , so React hacks around this by evaluating the selection after both and , which is smart! However, if you haven't an handler to your component, the part of the selection listening hack for Firefox won't ever fire. Which means if you happen to be doing something in that changes the selection, it won't be caught by as expected, such that the next time fires, the handler will be triggered (via the part of the hack), since React thinks the selection has changed. Example: You place your cursor at the end of a sentence. fires thanks to . updates the selection. You the last character: you handle deleting the character, and preventing default. doesn't fire, because on change hasn't taken place yet, as expected. updates the selection. You another character: you handle deleting another character. fires thanks to , but its internal state is comparing it to the selection before it was updated by , so it is out of date. Not expected. If you add a noop handler for , this problem goes away, since will always fire after rendering thanks to , and then it will never fire incorrectly due to . An example is in , actually doesn't do anything. Except without, the handling wouldn't stay in sync in Firefox. What is the expected behavior? Ideally I'd think that the event hack would still fire even without having to have the developer add a noop to their component? Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? React 15 in Firefox.\nThanks for the detailed report Sorry I didn't get to this until now. This should be an easy fix \u2013 just adding onKeyUp below onKeyDown here:", "positive_passages": [{"docid": "doc-en-react-d8a74583a7dd7438075fe70a8cbf57bf27e25367de6faa766691242e607a6889", "text": "topLevelTypes.topContextMenu, topLevelTypes.topFocus, topLevelTypes.topKeyDown, <ins> topLevelTypes.topKeyUp, </ins> topLevelTypes.topMouseDown, topLevelTypes.topMouseUp, topLevelTypes.topSelectionChange,", "commid": "react_pr_7533"}], "negative_passages": []} | |
| {"query_id": "q-en-react-0ed3c797ce6a8a28eb6a574bdcbec21d43c86de7cc53967b9c101ce45e8f2e8e", "query": "There appears to be a typo on line 116 of \"codebase-\". Specifically, I see one \"\" symbol. This results in all text after line 116 appearing as one large block of code. See the screenshot below, with the markdown code on the left and the stylized code rendered on the right: <img width=\"1389\" alt=\"screen shot 2017-01-09 at 2 38 51 pm\" src=\"\"Based on the content of the subsequent text after line 116, I would expect it to appear as the following: <img width=\"1436\" alt=\"screen shot 2017-01-09 at 2 42 08 pm\" src=\"\"If this is indeed something that should be fixed, I'd like to fix it, and can submit a PR immediately.\nI think you're right, please do submit a PR.\n(For future reference, feel free to send PRs for small fixes like this without creating an issue.)", "positive_passages": [{"docid": "doc-en-react-65cf806f73c3563aa2b997922e2cd99c2aa2c62cf7f7cd1bae37aa103096bc07", "text": "It is a good idea to avoid spamming the console with duplicate warnings: <del> ````js </del> <ins> ```js </ins> var warning = require('warning'); var didWarnAboutMath = false;", "commid": "react_pr_8726"}], "negative_passages": []} | |
| {"query_id": "q-en-react-861ae81f7d74ba45e4e4477af82464e5d0afb109ebec5733e2277a27e6beebff", "query": "Do you want to request a feature or report a bug? bug What is the current behavior? Selecting of the same value for the twice in a row results in triggering of change event twice for the same value. If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via or similar (template: ). Open and click twice on any option. As the result you'll see in console that change event is triggered each time (even if the changed value is equal to the previous one). For comparison you may check the native html implementation: What is the expected behavior? The change event should not trigger again for the same value. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? macOS Sierra 10.12.5, Safari 10.1.1\ncc\nThanks for the report It looks like this . We'll look into this and see if we can include a fix in the 15.6 release.\nIf you extend the given example with 4 radio elements (), fires only once per radio. In other words, the event is not fired if a value for a name changes. Might as well rename to () so it is clear when the callback is fired. But it seems to be a different problem than what is describing. Tested on Google Chrome Version 59.0.3071.86 (Official Build) (64-bit).\nSame as mentioned above, uncontrolled radio inputs in my project just stopped working as was expected, they stopped calling the onChange function if a radio button was checked before.\nThis particular issue was filed before 15.6 release so I don't think what you're describing is related to it. Can you confirm your bug is the same as\nyes i think this particular issue is not related indeed. I am almost certain the is the same bug I have the example here: sorry about the confusion\nThanks to and comments in I managed to understand that my reported issue is only affecting uncontrolled radio inputs. Here is a working example of controlled radios working as expected:\nWhile solutions works, I would love to see this fixed in React 15.6 release. Any news on this, it's been a few months. Thanks!\nI'm unable to reproduce the issue reported with the latest React 15 release: The issue where it only fires a single change event per input seems to still be a problem, which we will investigate separately. Thanks!", "positive_passages": [{"docid": "doc-en-react-92ce1029ef095c2332df8f67e4184201b3cfa25e3b4639438cfd1b6120cb55ec", "text": "In a traditional JavaScript application, you need to look at what data changed and imperatively make changes to the DOM to keep it up-to-date. Even AngularJS, <del> which provides a declarative interface via directives and data binding requires a linking function to manually update DOM nodes. </del> <ins> which provides a declarative interface via directives and data binding [requires a linking function to manually update DOM nodes](http://docs.angularjs.org/guide/directive#reasonsbehindthecompilelinkseparation). </ins> React takes a different approach.", "commid": "react_pr_56"}], "negative_passages": []} | |
| {"query_id": "q-en-react-861ae81f7d74ba45e4e4477af82464e5d0afb109ebec5733e2277a27e6beebff", "query": "Do you want to request a feature or report a bug? bug What is the current behavior? Selecting of the same value for the twice in a row results in triggering of change event twice for the same value. If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via or similar (template: ). Open and click twice on any option. As the result you'll see in console that change event is triggered each time (even if the changed value is equal to the previous one). For comparison you may check the native html implementation: What is the expected behavior? The change event should not trigger again for the same value. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? macOS Sierra 10.12.5, Safari 10.1.1\ncc\nThanks for the report It looks like this . We'll look into this and see if we can include a fix in the 15.6 release.\nIf you extend the given example with 4 radio elements (), fires only once per radio. In other words, the event is not fired if a value for a name changes. Might as well rename to () so it is clear when the callback is fired. But it seems to be a different problem than what is describing. Tested on Google Chrome Version 59.0.3071.86 (Official Build) (64-bit).\nSame as mentioned above, uncontrolled radio inputs in my project just stopped working as was expected, they stopped calling the onChange function if a radio button was checked before.\nThis particular issue was filed before 15.6 release so I don't think what you're describing is related to it. Can you confirm your bug is the same as\nyes i think this particular issue is not related indeed. I am almost certain the is the same bug I have the example here: sorry about the confusion\nThanks to and comments in I managed to understand that my reported issue is only affecting uncontrolled radio inputs. Here is a working example of controlled radios working as expected:\nWhile solutions works, I would love to see this fixed in React 15.6 release. Any news on this, it's been a few months. Thanks!\nI'm unable to reproduce the issue reported with the latest React 15 release: The issue where it only fires a single change event per input seems to still be a problem, which we will investigate separately. Thanks!", "positive_passages": [{"docid": "doc-en-react-83b6aed5d4db4951133cc2066b1477a66e05064e720ce3a32458ecc5461c3411", "text": "- Facebook has dynamic charts that render to `<canvas>` instead of HTML. - Instagram is a \"single page\" web app built entirely with React and `Backbone.Router`. Designers regularly contribute React code with JSX. <del> - We've built an internal prototype that runs React apps in a web worker. </del> <ins> - We've built internal prototypes that run React apps in a web worker and use React to drive **native iOS views** via an Objective-C bridge. </ins> - You can run React [on the server](http://github.com/petehunt/react-server-rendering) for SEO, performance, code sharing and overall flexibility.", "commid": "react_pr_56"}], "negative_passages": []} | |
| {"query_id": "q-en-react-3817139d4666799043c8e02266a0f1719e3ed97e579a53127c698cbb6429873d", "query": "<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug What is the current behavior? I have a component which listens for resize events (via a BlueprintJS ResizeSensor). When loading a component dynamically with / , an exception occurs as the resize sensor appears to be unmounted: The resize sensor . Demo: Related: What is the expected behavior? No exception is thrown. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Tested with: React 16.6.1, fails React 16.6.0, works\nCan you test if it works on master?\nNope, it's broken on master, and after bisecting, I confirmed the regression was caused by EDIT: Something else I found is that before the regression, doesn't execute, but now it does. EDIT 2: Yeah, throws when invoked with a suspended component, here's how you can reproduce. This is true both before and after the aforementioned PR, so in any case it looks like it helped us discover this :smile:\nEDIT: Something else I found is that before the regression, ResizeSensor.componentDidUpdate doesn't execute, but now it does. This sounds like a separate problem, can you provide a test case for it?\nHere's a minimal repro with ReactDOM:\nOkay, so a part of this is covered by It got first broken by and got fixed in . However I think repro case in might be a separate issue. Looking into it.\nThis sounds like a separate problem, can you provide a test case for it? Welp, turns out I'm wrong, I actually made a mistake when mocking which resulted in it not being called :stuckouttongueclosedeyes:\nAnother reproducible example: When does it throw: 16.6.0: never 16.6.1: on every \"display lazy\" click 16.7.0 until 16.8.6: on every \"display lazy\" click if the number of \"force update\" clicks is odd (meaning even number of render?)\nThis was likely fixed in Can you verify on master?\nYes, current fixes for me.\nThis will get into the next release then.\nSeems it still happens. ~I tried to get mini reproduce but it seems happened in complex environment.~ User report reproduce: Quick click the nav item will throw with ref: Update: Create a mini reproduce about this:\nSorry, we didn\u2019t release the fix yet.\nany ETA on when this will be available?\nWe are blocked by this, too (without a pretty significant workaround). Any sense of a release timeframe? Is there some way to find out (in general) when the \"next\" release is? Sorry if this is covered somewhere.. For the record, this is surfacing for us through Semantic UI React Dropdown. So we're beholden to them as well, but they point us here for the fix. :)\nany new updates?\nWe've published of all packages, which includes this fix. It is likely to be a release candidate for . You can give it a try now and see whether it resolves the issue for you. Thanks.\n(You should still ask packages to migrate away from though as it's eventually going to get deprecated.)\n0 hadn't fix this bug!\nAll reproductions linked in this issue ( and ) no longer crash with 16.9. If you still encounter this error message with 16.9 please open a new issue.", "positive_passages": [{"docid": "doc-en-react-6209a25f2b5d5edd56eb659a9c08eb93ec56ae507a6f982e2ecc3cb4a04b1166", "text": "ReactCache = require('react-cache'); Suspense = React.Suspense; container = document.createElement('div'); <ins> document.body.appendChild(container); </ins> TextResource = ReactCache.unstable_createResource(([text, ms = 0]) => { return new Promise((resolve, reject) =>", "commid": "react_pr_14197"}], "negative_passages": []} | |
| {"query_id": "q-en-react-3817139d4666799043c8e02266a0f1719e3ed97e579a53127c698cbb6429873d", "query": "<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug What is the current behavior? I have a component which listens for resize events (via a BlueprintJS ResizeSensor). When loading a component dynamically with / , an exception occurs as the resize sensor appears to be unmounted: The resize sensor . Demo: Related: What is the expected behavior? No exception is thrown. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Tested with: React 16.6.1, fails React 16.6.0, works\nCan you test if it works on master?\nNope, it's broken on master, and after bisecting, I confirmed the regression was caused by EDIT: Something else I found is that before the regression, doesn't execute, but now it does. EDIT 2: Yeah, throws when invoked with a suspended component, here's how you can reproduce. This is true both before and after the aforementioned PR, so in any case it looks like it helped us discover this :smile:\nEDIT: Something else I found is that before the regression, ResizeSensor.componentDidUpdate doesn't execute, but now it does. This sounds like a separate problem, can you provide a test case for it?\nHere's a minimal repro with ReactDOM:\nOkay, so a part of this is covered by It got first broken by and got fixed in . However I think repro case in might be a separate issue. Looking into it.\nThis sounds like a separate problem, can you provide a test case for it? Welp, turns out I'm wrong, I actually made a mistake when mocking which resulted in it not being called :stuckouttongueclosedeyes:\nAnother reproducible example: When does it throw: 16.6.0: never 16.6.1: on every \"display lazy\" click 16.7.0 until 16.8.6: on every \"display lazy\" click if the number of \"force update\" clicks is odd (meaning even number of render?)\nThis was likely fixed in Can you verify on master?\nYes, current fixes for me.\nThis will get into the next release then.\nSeems it still happens. ~I tried to get mini reproduce but it seems happened in complex environment.~ User report reproduce: Quick click the nav item will throw with ref: Update: Create a mini reproduce about this:\nSorry, we didn\u2019t release the fix yet.\nany ETA on when this will be available?\nWe are blocked by this, too (without a pretty significant workaround). Any sense of a release timeframe? Is there some way to find out (in general) when the \"next\" release is? Sorry if this is covered somewhere.. For the record, this is surfacing for us through Semantic UI React Dropdown. So we're beholden to them as well, but they point us here for the fix. :)\nany new updates?\nWe've published of all packages, which includes this fix. It is likely to be a release candidate for . You can give it a try now and see whether it resolves the issue for you. Thanks.\n(You should still ask packages to migrate away from though as it's eventually going to get deprecated.)\n0 hadn't fix this bug!\nAll reproductions linked in this issue ( and ) no longer crash with 16.9. If you still encounter this error message with 16.9 please open a new issue.", "positive_passages": [{"docid": "doc-en-react-53cbdf6fd6a3e255b0645fb9e776de5e726b22f94e3c89f02daddd9d6357d852", "text": "}, ([text, ms]) => text); }); <ins> afterEach(() => { document.body.removeChild(container); }); </ins> function advanceTimers(ms) { // Note: This advances Jest's virtual time but not React's. Use // ReactNoop.expire for that.", "commid": "react_pr_14197"}], "negative_passages": []} | |
| {"query_id": "q-en-react-3817139d4666799043c8e02266a0f1719e3ed97e579a53127c698cbb6429873d", "query": "<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug What is the current behavior? I have a component which listens for resize events (via a BlueprintJS ResizeSensor). When loading a component dynamically with / , an exception occurs as the resize sensor appears to be unmounted: The resize sensor . Demo: Related: What is the expected behavior? No exception is thrown. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Tested with: React 16.6.1, fails React 16.6.0, works\nCan you test if it works on master?\nNope, it's broken on master, and after bisecting, I confirmed the regression was caused by EDIT: Something else I found is that before the regression, doesn't execute, but now it does. EDIT 2: Yeah, throws when invoked with a suspended component, here's how you can reproduce. This is true both before and after the aforementioned PR, so in any case it looks like it helped us discover this :smile:\nEDIT: Something else I found is that before the regression, ResizeSensor.componentDidUpdate doesn't execute, but now it does. This sounds like a separate problem, can you provide a test case for it?\nHere's a minimal repro with ReactDOM:\nOkay, so a part of this is covered by It got first broken by and got fixed in . However I think repro case in might be a separate issue. Looking into it.\nThis sounds like a separate problem, can you provide a test case for it? Welp, turns out I'm wrong, I actually made a mistake when mocking which resulted in it not being called :stuckouttongueclosedeyes:\nAnother reproducible example: When does it throw: 16.6.0: never 16.6.1: on every \"display lazy\" click 16.7.0 until 16.8.6: on every \"display lazy\" click if the number of \"force update\" clicks is odd (meaning even number of render?)\nThis was likely fixed in Can you verify on master?\nYes, current fixes for me.\nThis will get into the next release then.\nSeems it still happens. ~I tried to get mini reproduce but it seems happened in complex environment.~ User report reproduce: Quick click the nav item will throw with ref: Update: Create a mini reproduce about this:\nSorry, we didn\u2019t release the fix yet.\nany ETA on when this will be available?\nWe are blocked by this, too (without a pretty significant workaround). Any sense of a release timeframe? Is there some way to find out (in general) when the \"next\" release is? Sorry if this is covered somewhere.. For the record, this is surfacing for us through Semantic UI React Dropdown. So we're beholden to them as well, but they point us here for the fix. :)\nany new updates?\nWe've published of all packages, which includes this fix. It is likely to be a release candidate for . You can give it a try now and see whether it resolves the issue for you. Thanks.\n(You should still ask packages to migrate away from though as it's eventually going to get deprecated.)\n0 hadn't fix this bug!\nAll reproductions linked in this issue ( and ) no longer crash with 16.9. If you still encounter this error message with 16.9 please open a new issue.", "positive_passages": [{"docid": "doc-en-react-6c924b6f749e920e4f13d9d8bb7b9592aa026ea5edc52fbb617eeb241aa29f5d", "text": "); }, ); <ins> // Regression test for https://github.com/facebook/react/issues/14188 it('can call findDOMNode() in a suspended component commit phase', async () => { const log = []; const Lazy = React.lazy( () => new Promise(resolve => resolve({ default() { return 'lazy'; }, }), ), ); class Child extends React.Component { componentDidMount() { log.push('cDM ' + this.props.id); ReactDOM.findDOMNode(this); } componentDidUpdate() { log.push('cDU ' + this.props.id); ReactDOM.findDOMNode(this); } render() { return 'child'; } } const buttonRef = React.createRef(); class App extends React.Component { state = { suspend: false, }; handleClick = () => { this.setState({suspend: true}); }; render() { return ( <React.Suspense fallback=\"Loading\"> <Child id=\"first\" /> <button ref={buttonRef} onClick={this.handleClick}> Suspend </button> <Child id=\"second\" /> {this.state.suspend && <Lazy />} </React.Suspense> ); } } ReactDOM.render(<App />, container); expect(log).toEqual(['cDM first', 'cDM second']); log.length = 0; buttonRef.current.dispatchEvent(new MouseEvent('click', {bubbles: true})); await Lazy; expect(log).toEqual(['cDU first', 'cDU second']); }); </ins> });", "commid": "react_pr_14197"}], "negative_passages": []} | |
| {"query_id": "q-en-react-a506d65bc94ff81018b38f2a41e7255deb80a0db888078963255e5a9231529d4", "query": "I\u2019ve seen the \u201crendered fewer hooks than expected\u201d invariant a couple times now pointing at a component rendered as a part of an error boundary that just caught an error when that component does not use hooks at all. I\u2019ve been able to fix this issue by un-commenting: I haven\u2019t been able to produce a minimal test-case yet . I\u2019m reporting anyway with the temporary fix that worked for me in case you have any insight on what a minimal test-case could be. I\u2019ll update this issue if I keep running into the problem and I can create a minimal test-case.\nI ran into the issue again and was able to produce a small repro: Pressing the \u201cthrow\u201d button results in the invariant: With a component stack of: Which is weird since has no hooks!\nWanna look into fixing? Should be easy \u2014 there must be a missing call somewhere. Or maybe doesn't reset everything we need.\nI looked into it, wrote a test, and discovered it\u2019s fixed on master The test is broken on 16.8.6, I didn\u2019t bother bisecting to find the commit that fixed it. PR for the test: .\nI thought I was seeing this in 16.9, but it turns out we were on and , and both need to be updated for this to work.", "positive_passages": [{"docid": "doc-en-react-65d9a0a4c0eea8c4a5c5275a146425908501bb1d38e1c8b89289290f0be80060", "text": "Scheduler.flushAll(); expect(root).toMatchRenderedOutput('hello'); }); <ins> // Regression test for https://github.com/facebook/react/issues/15732 it('resets hooks when an error is thrown in the middle of a list of hooks', async () => { const {useEffect, useState} = React; class ErrorBoundary extends React.Component { state = {hasError: false}; static getDerivedStateFromError() { return {hasError: true}; } render() { return ( <Wrapper> {this.state.hasError ? 'Error!' : this.props.children} </Wrapper> ); } } function Wrapper({children}) { return children; } let setShouldThrow; function Thrower() { const [shouldThrow, _setShouldThrow] = useState(false); setShouldThrow = _setShouldThrow; if (shouldThrow) { throw new Error('Throw!'); } useEffect(() => {}, []); return 'Throw!'; } const root = ReactTestRenderer.create( <ErrorBoundary> <Thrower /> </ErrorBoundary>, ); expect(root).toMatchRenderedOutput('Throw!'); act(() => setShouldThrow(true)); expect(root).toMatchRenderedOutput('Error!'); }); </ins> });", "commid": "react_pr_15747"}], "negative_passages": []} | |
| {"query_id": "q-en-react-76eb34563a67d7a2713a368b256cfe87ae0b40db9e1db1a30a207f7a19751756", "query": ": However, given: I'm getting a log when I click on the unprofiled counter. Reproduction: Am I misunderstanding this API, or is this a bug?\nAs the state is being updated by Counter function which is being called on both the profiled and unprofiled counter, is causing re render and is being called both the times.\nThanks but I'm pretty sure that the way it's documented (and what would be sensible) it shouldn't be operating like that. Also, I tried making a separate component instead of using the same one and I got the same result.\nAt a quick glance it does look unexpected. Don't have time to dig in further at the moment though.\nIt seems that this occurs for elements which have same type with greater or equal depth in same tree. See:\nI don't think it has anything to do with the element type, but where they are declared relative to where the tags are defined. It looks like for a subtree that belongs to a single owner- rendering further down in the subtree will cause the Profiler higher up to call . Given the above example:\nThis does not look to be hooks-specific, nor is it a recent regression. (Same behavior is exhibited for class components in the earliest release of the Profiler component- v16.5.)\nIt seems that the is always marked as in phase.\nThanks", "positive_passages": [{"docid": "doc-en-react-a89f0b2cac4869a3b8ea690eae250ca99e33423536b308179ec7ec72f8d1dd17", "text": "} case Profiler: if (enableProfilerTimer) { <del> workInProgress.effectTag |= Update; </del> <ins> // Profiler should only call onRender when one of its descendants actually rendered. const hasChildWork = workInProgress.childExpirationTime >= renderExpirationTime; if (hasChildWork) { workInProgress.effectTag |= Update; } </ins> } break; case SuspenseComponent: {", "commid": "react_pr_17223"}], "negative_passages": []} | |
| {"query_id": "q-en-react-76eb34563a67d7a2713a368b256cfe87ae0b40db9e1db1a30a207f7a19751756", "query": ": However, given: I'm getting a log when I click on the unprofiled counter. Reproduction: Am I misunderstanding this API, or is this a bug?\nAs the state is being updated by Counter function which is being called on both the profiled and unprofiled counter, is causing re render and is being called both the times.\nThanks but I'm pretty sure that the way it's documented (and what would be sensible) it shouldn't be operating like that. Also, I tried making a separate component instead of using the same one and I got the same result.\nAt a quick glance it does look unexpected. Don't have time to dig in further at the moment though.\nIt seems that this occurs for elements which have same type with greater or equal depth in same tree. See:\nI don't think it has anything to do with the element type, but where they are declared relative to where the tags are defined. It looks like for a subtree that belongs to a single owner- rendering further down in the subtree will cause the Profiler higher up to call . Given the above example:\nThis does not look to be hooks-specific, nor is it a recent regression. (Same behavior is exhibited for class components in the earliest release of the Profiler component- v16.5.)\nIt seems that the is always marked as in phase.\nThanks", "positive_passages": [{"docid": "doc-en-react-9f98db2a443bd3dcd9c8cd3f3384418c7db45be5ecd7d7fa9d8050f88401fcfa", "text": "); }); <ins> it('does not report work done on a sibling', () => { const callback = jest.fn(); const DoesNotUpdate = React.memo(function DoesNotUpdateInner() { Scheduler.unstable_advanceTime(10); return null; }, () => true); let updateProfilerSibling; function ProfilerSibling() { const [count, setCount] = React.useState(0); updateProfilerSibling = () => setCount(count + 1); return null; } function App() { return ( <React.Fragment> <React.Profiler id=\"test\" onRender={callback}> <DoesNotUpdate /> </React.Profiler> <ProfilerSibling /> </React.Fragment> ); } const renderer = ReactTestRenderer.create(<App />); expect(callback).toHaveBeenCalledTimes(1); let call = callback.mock.calls[0]; expect(call).toHaveLength(enableSchedulerTracing ? 7 : 6); expect(call[0]).toBe('test'); expect(call[1]).toBe('mount'); expect(call[2]).toBe(10); // actual time expect(call[3]).toBe(10); // base time expect(call[4]).toBe(0); // start time expect(call[5]).toBe(10); // commit time expect(call[6]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events callback.mockReset(); Scheduler.unstable_advanceTime(20); // 10 -> 30 // Updating a parent should report a re-render, // since React technically did a little bit of work between the Profiler and the bailed out subtree. renderer.update(<App />); expect(callback).toHaveBeenCalledTimes(1); call = callback.mock.calls[0]; expect(call).toHaveLength(enableSchedulerTracing ? 7 : 6); expect(call[0]).toBe('test'); expect(call[1]).toBe('update'); expect(call[2]).toBe(0); // actual time expect(call[3]).toBe(10); // base time expect(call[4]).toBe(30); // start time expect(call[5]).toBe(30); // commit time expect(call[6]).toEqual(enableSchedulerTracing ? new Set() : undefined); // interaction events callback.mockReset(); Scheduler.unstable_advanceTime(20); // 30 -> 50 // Updating a sibling should not report a re-render. ReactTestRenderer.act(updateProfilerSibling); expect(callback).not.toHaveBeenCalled(); }); </ins> it('logs render times for both mount and update', () => { const callback = jest.fn();", "commid": "react_pr_17223"}], "negative_passages": []} | |
| {"query_id": "q-en-react-76eb34563a67d7a2713a368b256cfe87ae0b40db9e1db1a30a207f7a19751756", "query": ": However, given: I'm getting a log when I click on the unprofiled counter. Reproduction: Am I misunderstanding this API, or is this a bug?\nAs the state is being updated by Counter function which is being called on both the profiled and unprofiled counter, is causing re render and is being called both the times.\nThanks but I'm pretty sure that the way it's documented (and what would be sensible) it shouldn't be operating like that. Also, I tried making a separate component instead of using the same one and I got the same result.\nAt a quick glance it does look unexpected. Don't have time to dig in further at the moment though.\nIt seems that this occurs for elements which have same type with greater or equal depth in same tree. See:\nI don't think it has anything to do with the element type, but where they are declared relative to where the tags are defined. It looks like for a subtree that belongs to a single owner- rendering further down in the subtree will cause the Profiler higher up to call . Given the above example:\nThis does not look to be hooks-specific, nor is it a recent regression. (Same behavior is exhibited for class components in the earliest release of the Profiler component- v16.5.)\nIt seems that the is always marked as in phase.\nThanks", "positive_passages": [{"docid": "doc-en-react-08c42cf431b916b22ced085cd69d07ca68aaea32605a377828ff3d6da4b26992", "text": "Scheduler.unstable_advanceTime(5); // 0 -> 5 ReactTestRenderer.create( <del> <> </del> <ins> <React.Fragment> </ins> <React.Profiler id=\"parent\" onRender={callback}> <AdvanceTime byAmount={10}> <React.Profiler id=\"child\" onRender={callback}>", "commid": "react_pr_17223"}], "negative_passages": []} | |
| {"query_id": "q-en-react-76eb34563a67d7a2713a368b256cfe87ae0b40db9e1db1a30a207f7a19751756", "query": ": However, given: I'm getting a log when I click on the unprofiled counter. Reproduction: Am I misunderstanding this API, or is this a bug?\nAs the state is being updated by Counter function which is being called on both the profiled and unprofiled counter, is causing re render and is being called both the times.\nThanks but I'm pretty sure that the way it's documented (and what would be sensible) it shouldn't be operating like that. Also, I tried making a separate component instead of using the same one and I got the same result.\nAt a quick glance it does look unexpected. Don't have time to dig in further at the moment though.\nIt seems that this occurs for elements which have same type with greater or equal depth in same tree. See:\nI don't think it has anything to do with the element type, but where they are declared relative to where the tags are defined. It looks like for a subtree that belongs to a single owner- rendering further down in the subtree will cause the Profiler higher up to call . Given the above example:\nThis does not look to be hooks-specific, nor is it a recent regression. (Same behavior is exhibited for class components in the earliest release of the Profiler component- v16.5.)\nIt seems that the is always marked as in phase.\nThanks", "positive_passages": [{"docid": "doc-en-react-fb781bf877d85dffa9028cff3949590ba7e26bfb1dde624fa515447fa84bd6e6", "text": "</React.Profiler> </AdvanceTime> </React.Profiler> <del> </>, </del> <ins> </React.Fragment>, </ins> ); expect(callback).toHaveBeenCalledTimes(2);", "commid": "react_pr_17223"}], "negative_passages": []} | |
| {"query_id": "q-en-react-76eb34563a67d7a2713a368b256cfe87ae0b40db9e1db1a30a207f7a19751756", "query": ": However, given: I'm getting a log when I click on the unprofiled counter. Reproduction: Am I misunderstanding this API, or is this a bug?\nAs the state is being updated by Counter function which is being called on both the profiled and unprofiled counter, is causing re render and is being called both the times.\nThanks but I'm pretty sure that the way it's documented (and what would be sensible) it shouldn't be operating like that. Also, I tried making a separate component instead of using the same one and I got the same result.\nAt a quick glance it does look unexpected. Don't have time to dig in further at the moment though.\nIt seems that this occurs for elements which have same type with greater or equal depth in same tree. See:\nI don't think it has anything to do with the element type, but where they are declared relative to where the tags are defined. It looks like for a subtree that belongs to a single owner- rendering further down in the subtree will cause the Profiler higher up to call . Given the above example:\nThis does not look to be hooks-specific, nor is it a recent regression. (Same behavior is exhibited for class components in the earliest release of the Profiler component- v16.5.)\nIt seems that the is always marked as in phase.\nThanks", "positive_passages": [{"docid": "doc-en-react-90a06ea5f9b787f43db7a85f516e5053e6acfcb570de02e762c328567228eb8d", "text": "Scheduler.unstable_advanceTime(5); // 0 -> 5 ReactTestRenderer.create( <del> <> </del> <ins> <React.Fragment> </ins> <React.Profiler id=\"first\" onRender={callback}> <AdvanceTime byAmount={20} /> </React.Profiler> <React.Profiler id=\"second\" onRender={callback}> <AdvanceTime byAmount={5} /> </React.Profiler> <del> </>, </del> <ins> </React.Fragment>, </ins> ); expect(callback).toHaveBeenCalledTimes(2);", "commid": "react_pr_17223"}], "negative_passages": []} | |
| {"query_id": "q-en-react-76eb34563a67d7a2713a368b256cfe87ae0b40db9e1db1a30a207f7a19751756", "query": ": However, given: I'm getting a log when I click on the unprofiled counter. Reproduction: Am I misunderstanding this API, or is this a bug?\nAs the state is being updated by Counter function which is being called on both the profiled and unprofiled counter, is causing re render and is being called both the times.\nThanks but I'm pretty sure that the way it's documented (and what would be sensible) it shouldn't be operating like that. Also, I tried making a separate component instead of using the same one and I got the same result.\nAt a quick glance it does look unexpected. Don't have time to dig in further at the moment though.\nIt seems that this occurs for elements which have same type with greater or equal depth in same tree. See:\nI don't think it has anything to do with the element type, but where they are declared relative to where the tags are defined. It looks like for a subtree that belongs to a single owner- rendering further down in the subtree will cause the Profiler higher up to call . Given the above example:\nThis does not look to be hooks-specific, nor is it a recent regression. (Same behavior is exhibited for class components in the earliest release of the Profiler component- v16.5.)\nIt seems that the is always marked as in phase.\nThanks", "positive_passages": [{"docid": "doc-en-react-a6d08422a5c943eb7d86a2c23e477cbe98949f3b483adfbff0a185d68a82708a", "text": "Scheduler.unstable_advanceTime(5); // 0 -> 5 ReactTestRenderer.create( <del> <> </del> <ins> <React.Fragment> </ins> <AdvanceTime byAmount={20} /> <React.Profiler id=\"test\" onRender={callback}> <AdvanceTime byAmount={5} /> </React.Profiler> <AdvanceTime byAmount={20} /> <del> </>, </del> <ins> </React.Fragment>, </ins> ); expect(callback).toHaveBeenCalledTimes(1);", "commid": "react_pr_17223"}], "negative_passages": []} | |
| {"query_id": "q-en-react-76eb34563a67d7a2713a368b256cfe87ae0b40db9e1db1a30a207f7a19751756", "query": ": However, given: I'm getting a log when I click on the unprofiled counter. Reproduction: Am I misunderstanding this API, or is this a bug?\nAs the state is being updated by Counter function which is being called on both the profiled and unprofiled counter, is causing re render and is being called both the times.\nThanks but I'm pretty sure that the way it's documented (and what would be sensible) it shouldn't be operating like that. Also, I tried making a separate component instead of using the same one and I got the same result.\nAt a quick glance it does look unexpected. Don't have time to dig in further at the moment though.\nIt seems that this occurs for elements which have same type with greater or equal depth in same tree. See:\nI don't think it has anything to do with the element type, but where they are declared relative to where the tags are defined. It looks like for a subtree that belongs to a single owner- rendering further down in the subtree will cause the Profiler higher up to call . Given the above example:\nThis does not look to be hooks-specific, nor is it a recent regression. (Same behavior is exhibited for class components in the earliest release of the Profiler component- v16.5.)\nIt seems that the is always marked as in phase.\nThanks", "positive_passages": [{"docid": "doc-en-react-6de1770c683920b9491c28752822ebaa169746b3515c048c2524d9c4c815d2eb", "text": "} } <del> class Pure extends React.PureComponent { render() { return this.props.children; } } </del> const renderer = ReactTestRenderer.create( <React.Profiler id=\"outer\" onRender={callback}> <Updater> <del> <React.Profiler id=\"middle\" onRender={callback}> <Pure> <React.Profiler id=\"inner\" onRender={callback}> <div /> </React.Profiler> </Pure> </del> <ins> <React.Profiler id=\"inner\" onRender={callback}> <div /> </ins> </React.Profiler> </Updater> </React.Profiler>, ); // All profile callbacks are called for initial render <del> expect(callback).toHaveBeenCalledTimes(3); </del> <ins> expect(callback).toHaveBeenCalledTimes(2); </ins> callback.mockReset();", "commid": "react_pr_17223"}], "negative_passages": []} | |
| {"query_id": "q-en-react-76eb34563a67d7a2713a368b256cfe87ae0b40db9e1db1a30a207f7a19751756", "query": ": However, given: I'm getting a log when I click on the unprofiled counter. Reproduction: Am I misunderstanding this API, or is this a bug?\nAs the state is being updated by Counter function which is being called on both the profiled and unprofiled counter, is causing re render and is being called both the times.\nThanks but I'm pretty sure that the way it's documented (and what would be sensible) it shouldn't be operating like that. Also, I tried making a separate component instead of using the same one and I got the same result.\nAt a quick glance it does look unexpected. Don't have time to dig in further at the moment though.\nIt seems that this occurs for elements which have same type with greater or equal depth in same tree. See:\nI don't think it has anything to do with the element type, but where they are declared relative to where the tags are defined. It looks like for a subtree that belongs to a single owner- rendering further down in the subtree will cause the Profiler higher up to call . Given the above example:\nThis does not look to be hooks-specific, nor is it a recent regression. (Same behavior is exhibited for class components in the earliest release of the Profiler component- v16.5.)\nIt seems that the is always marked as in phase.\nThanks", "positive_passages": [{"docid": "doc-en-react-316689dac6224d71a18d85929d82290c223638756366f8776dbc72b23d2c5b18", "text": "}); }); <del> // Only call profile updates for paths that have re-rendered // Since \"inner\" is beneath a pure component, it isn't called expect(callback).toHaveBeenCalledTimes(2); expect(callback.mock.calls[0][0]).toBe('middle'); expect(callback.mock.calls[1][0]).toBe('outer'); </del> <ins> // Only call onRender for paths that have re-rendered. // Since the Updater's props didn't change, // React does not re-render its children. expect(callback).toHaveBeenCalledTimes(1); expect(callback.mock.calls[0][0]).toBe('outer'); </ins> }); it('decreases actual time but not base time when sCU prevents an update', () => {", "commid": "react_pr_17223"}], "negative_passages": []} | |
| {"query_id": "q-en-react-76eb34563a67d7a2713a368b256cfe87ae0b40db9e1db1a30a207f7a19751756", "query": ": However, given: I'm getting a log when I click on the unprofiled counter. Reproduction: Am I misunderstanding this API, or is this a bug?\nAs the state is being updated by Counter function which is being called on both the profiled and unprofiled counter, is causing re render and is being called both the times.\nThanks but I'm pretty sure that the way it's documented (and what would be sensible) it shouldn't be operating like that. Also, I tried making a separate component instead of using the same one and I got the same result.\nAt a quick glance it does look unexpected. Don't have time to dig in further at the moment though.\nIt seems that this occurs for elements which have same type with greater or equal depth in same tree. See:\nI don't think it has anything to do with the element type, but where they are declared relative to where the tags are defined. It looks like for a subtree that belongs to a single owner- rendering further down in the subtree will cause the Profiler higher up to call . Given the above example:\nThis does not look to be hooks-specific, nor is it a recent regression. (Same behavior is exhibited for class components in the earliest release of the Profiler component- v16.5.)\nIt seems that the is always marked as in phase.\nThanks", "positive_passages": [{"docid": "doc-en-react-c1128494dcd2c03700c66170c9a19ec7485d12e17d6aedf2bd87d6e492329c4b", "text": "render() { instance = this; return ( <del> <> </del> <ins> <React.Fragment> </ins> <Yield value=\"first\" /> {this.state.count} <Yield value=\"last\" /> <del> </> </del> <ins> </React.Fragment> </ins> ); } }", "commid": "react_pr_17223"}], "negative_passages": []} | |
| {"query_id": "q-en-react-27e2dabd7c12087a82b59e8f48aa00487c99dbd448f17dc4c8c44d8d33b734af", "query": "<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug What is the current behavior? Bailing out doesn't work properly in lazy components with default props. It seems we're incorrectly . If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle () or CodeSandbox () example below: What is the expected behavior? In the example above, shouldn't have been called when the button is clicked. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?\nThis issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.\nClosing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!\nCan you turn this into a failing test please?\nSure.\nSend a PR?\nOK\nFeel free to add a fix if you know where the bug is", "positive_passages": [{"docid": "doc-en-react-46beefd74367193c1721f7df2618323e70af81a25d5de02eee804981c86e4c90", "text": "); if (__DEV__) { const inst = workInProgress.stateNode; <del> if (inst.props !== nextProps) { </del> <ins> if (shouldUpdate && inst.props !== nextProps) { </ins> if (!didWarnAboutReassigningProps) { console.error( 'It looks like %s is reassigning its own `this.props` while rendering. ' +", "commid": "react_pr_18539"}], "negative_passages": []} | |
| {"query_id": "q-en-react-27e2dabd7c12087a82b59e8f48aa00487c99dbd448f17dc4c8c44d8d33b734af", "query": "<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug What is the current behavior? Bailing out doesn't work properly in lazy components with default props. It seems we're incorrectly . If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle () or CodeSandbox () example below: What is the expected behavior? In the example above, shouldn't have been called when the button is clicked. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?\nThis issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.\nClosing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!\nCan you turn this into a failing test please?\nSure.\nSend a PR?\nOK\nFeel free to add a fix if you know where the bug is", "positive_passages": [{"docid": "doc-en-react-37e90eee3dbf38f508b0345fcf49fb7a9ef9db60c9008e258a30b780c84de5e1", "text": "cloneUpdateQueue(current, workInProgress); <del> const oldProps = workInProgress.memoizedProps; instance.props = </del> <ins> const unresolvedOldProps = workInProgress.memoizedProps; const oldProps = </ins> workInProgress.type === workInProgress.elementType <del> ? oldProps : resolveDefaultProps(workInProgress.type, oldProps); </del> <ins> ? unresolvedOldProps : resolveDefaultProps(workInProgress.type, unresolvedOldProps); instance.props = oldProps; const unresolvedNewProps = workInProgress.pendingProps; </ins> const oldContext = instance.context; const contextType = ctor.contextType;", "commid": "react_pr_18539"}], "negative_passages": []} | |
| {"query_id": "q-en-react-27e2dabd7c12087a82b59e8f48aa00487c99dbd448f17dc4c8c44d8d33b734af", "query": "<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug What is the current behavior? Bailing out doesn't work properly in lazy components with default props. It seems we're incorrectly . If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle () or CodeSandbox () example below: What is the expected behavior? In the example above, shouldn't have been called when the button is clicked. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?\nThis issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.\nClosing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!\nCan you turn this into a failing test please?\nSure.\nSend a PR?\nOK\nFeel free to add a fix if you know where the bug is", "positive_passages": [{"docid": "doc-en-react-8967f32e433f822fea9a24e449bdef862555ebe03f655856daa2221464c232e1", "text": "(typeof instance.UNSAFE_componentWillReceiveProps === 'function' || typeof instance.componentWillReceiveProps === 'function') ) { <del> if (oldProps !== newProps || oldContext !== nextContext) { </del> <ins> if ( unresolvedOldProps !== unresolvedNewProps || oldContext !== nextContext ) { </ins> callComponentWillReceiveProps( workInProgress, instance,", "commid": "react_pr_18539"}], "negative_passages": []} | |
| {"query_id": "q-en-react-27e2dabd7c12087a82b59e8f48aa00487c99dbd448f17dc4c8c44d8d33b734af", "query": "<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug What is the current behavior? Bailing out doesn't work properly in lazy components with default props. It seems we're incorrectly . If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle () or CodeSandbox () example below: What is the expected behavior? In the example above, shouldn't have been called when the button is clicked. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?\nThis issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.\nClosing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!\nCan you turn this into a failing test please?\nSure.\nSend a PR?\nOK\nFeel free to add a fix if you know where the bug is", "positive_passages": [{"docid": "doc-en-react-fbf5da77cfa162c01513ada1bdaaa5adb28d4e4f38c5f1602a75adf4b5e842c9", "text": "newState = workInProgress.memoizedState; if ( <del> oldProps === newProps && </del> <ins> unresolvedOldProps === unresolvedNewProps && </ins> oldState === newState && !hasContextChanged() && !checkHasForceUpdateAfterProcessing()", "commid": "react_pr_18539"}], "negative_passages": []} | |
| {"query_id": "q-en-react-27e2dabd7c12087a82b59e8f48aa00487c99dbd448f17dc4c8c44d8d33b734af", "query": "<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug What is the current behavior? Bailing out doesn't work properly in lazy components with default props. It seems we're incorrectly . If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle () or CodeSandbox () example below: What is the expected behavior? In the example above, shouldn't have been called when the button is clicked. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?\nThis issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.\nClosing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!\nCan you turn this into a failing test please?\nSure.\nSend a PR?\nOK\nFeel free to add a fix if you know where the bug is", "positive_passages": [{"docid": "doc-en-react-f4cc3ef29747b031c45e4cd869ac7ed92a72052109d2e19cb8d9180ed5eb9bd8", "text": "// effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidUpdate === 'function') { if ( <del> oldProps !== current.memoizedProps || </del> <ins> unresolvedOldProps !== current.memoizedProps || </ins> oldState !== current.memoizedState ) { workInProgress.effectTag |= Update;", "commid": "react_pr_18539"}], "negative_passages": []} | |
| {"query_id": "q-en-react-27e2dabd7c12087a82b59e8f48aa00487c99dbd448f17dc4c8c44d8d33b734af", "query": "<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug What is the current behavior? Bailing out doesn't work properly in lazy components with default props. It seems we're incorrectly . If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle () or CodeSandbox () example below: What is the expected behavior? In the example above, shouldn't have been called when the button is clicked. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?\nThis issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.\nClosing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!\nCan you turn this into a failing test please?\nSure.\nSend a PR?\nOK\nFeel free to add a fix if you know where the bug is", "positive_passages": [{"docid": "doc-en-react-312d4a074bbd9efa4f979633a3d7d583128bcd68898b3067f59667bbe2e6d43a", "text": "} if (typeof instance.getSnapshotBeforeUpdate === 'function') { if ( <del> oldProps !== current.memoizedProps || </del> <ins> unresolvedOldProps !== current.memoizedProps || </ins> oldState !== current.memoizedState ) { workInProgress.effectTag |= Snapshot;", "commid": "react_pr_18539"}], "negative_passages": []} | |
| {"query_id": "q-en-react-27e2dabd7c12087a82b59e8f48aa00487c99dbd448f17dc4c8c44d8d33b734af", "query": "<!-- Note: if the issue is about documentation or the website, please file it at: --Do you want to request a feature or report a bug? Bug What is the current behavior? Bailing out doesn't work properly in lazy components with default props. It seems we're incorrectly . If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle () or CodeSandbox () example below: What is the expected behavior? In the example above, shouldn't have been called when the button is clicked. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?\nThis issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution.\nClosing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!\nCan you turn this into a failing test please?\nSure.\nSend a PR?\nOK\nFeel free to add a fix if you know where the bug is", "positive_passages": [{"docid": "doc-en-react-a4939f9fc327e475ff468a66a8927faea55a5732a12dc3c918d597d399424257", "text": "expect(root).toMatchRenderedOutput('SiblingB'); }); <ins> it('resolves defaultProps without breaking bailout due to unchanged props and state, #17151', async () => { class LazyImpl extends React.Component { static defaultProps = {value: 0}; render() { const text = `${this.props.label}: ${this.props.value}`; return <Text text={text} />; } } const Lazy = lazy(() => fakeImport(LazyImpl)); const instance1 = React.createRef(null); const instance2 = React.createRef(null); const root = ReactTestRenderer.create( <> <LazyImpl ref={instance1} label=\"Not lazy\" /> <Suspense fallback={<Text text=\"Loading...\" />}> <Lazy ref={instance2} label=\"Lazy\" /> </Suspense> </>, { unstable_isConcurrent: true, }, ); expect(Scheduler).toFlushAndYield(['Not lazy: 0', 'Loading...']); expect(root).not.toMatchRenderedOutput('Not lazy: 0Lazy: 0'); await Promise.resolve(); expect(Scheduler).toFlushAndYield(['Lazy: 0']); expect(root).toMatchRenderedOutput('Not lazy: 0Lazy: 0'); // Should bailout due to unchanged props and state instance1.current.setState(null); expect(Scheduler).toFlushAndYield([]); expect(root).toMatchRenderedOutput('Not lazy: 0Lazy: 0'); // Should bailout due to unchanged props and state instance2.current.setState(null); expect(Scheduler).toFlushAndYield([]); expect(root).toMatchRenderedOutput('Not lazy: 0Lazy: 0'); }); it('resolves defaultProps without breaking bailout in PureComponent, #17151', async () => { class LazyImpl extends React.PureComponent { static defaultProps = {value: 0}; state = {}; render() { const text = `${this.props.label}: ${this.props.value}`; return <Text text={text} />; } } const Lazy = lazy(() => fakeImport(LazyImpl)); const instance1 = React.createRef(null); const instance2 = React.createRef(null); const root = ReactTestRenderer.create( <> <LazyImpl ref={instance1} label=\"Not lazy\" /> <Suspense fallback={<Text text=\"Loading...\" />}> <Lazy ref={instance2} label=\"Lazy\" /> </Suspense> </>, { unstable_isConcurrent: true, }, ); expect(Scheduler).toFlushAndYield(['Not lazy: 0', 'Loading...']); expect(root).not.toMatchRenderedOutput('Not lazy: 0Lazy: 0'); await Promise.resolve(); expect(Scheduler).toFlushAndYield(['Lazy: 0']); expect(root).toMatchRenderedOutput('Not lazy: 0Lazy: 0'); // Should bailout due to shallow equal props and state instance1.current.setState({}); expect(Scheduler).toFlushAndYield([]); expect(root).toMatchRenderedOutput('Not lazy: 0Lazy: 0'); // Should bailout due to shallow equal props and state instance2.current.setState({}); expect(Scheduler).toFlushAndYield([]); expect(root).toMatchRenderedOutput('Not lazy: 0Lazy: 0'); }); </ins> it('sets defaultProps for modern lifecycles', async () => { class C extends React.Component { static defaultProps = {text: 'A'};", "commid": "react_pr_18539"}], "negative_passages": []} | |
| {"query_id": "q-en-react-523ee0a3fa8d144501fae10a8df7b94dc4fd61979112e670abaab6c84ab7543b", "query": "React version: 16.13.1 This code works fine when using plain , but fails: when is enabled: The warning is caused by an exception happened in this block: This is happening because module brings its own implementation of the object with slightly different behavior which requires context to be properly preserved. This one-line change should do the fix: This issue has also been reported to React-testing-library, which has similar code: Why should this be a fix in React and not in ESM? React relied on undocumented behavior of Node modules loader. It was never guaranteed that it will work without proper context. In fact, it will not work as expected if you try it with any non built-in module The current code in React may break in future if module will be replaced with anything else, or if changes their internal implementation.\nDo you want to submit a PR It sounds like a reasonable thing for us to fix.\nI could, however I am not sure about testing part. What kind of tests would you expect for this?", "positive_passages": [{"docid": "doc-en-react-5cb7765e5a8008bf69b4ce015c8eae0bfaff49867f0ec035de36017cf00d179c", "text": "const nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's // version of setImmediate, bypassing fake timers if any. <del> enqueueTaskImpl = nodeRequire('timers').setImmediate; </del> <ins> enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate; </ins> } catch (_err) { // we're in a browser // we can't use regular timers because they may still be faked", "commid": "react_pr_18632"}], "negative_passages": []} | |
| {"query_id": "q-en-react-10810746cb0224e7895a005956955947a1042f876c9acc958030d61ccf711e69", "query": "<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --Looks like you forgot about the debugger inside the React dev tools version: 4.8.0 (or install) the latest version of devtools devtools code will be stopped on the debugger inside ! If I open devtools with react dev tools extension it will stop every time on debugger inside It doesn't seem like it should be happening\nSame here, I've had to disable the extension because of this... :smile:\nSame for me.\nLooks bad.\nSame here\nThat's the guy you're looking for :D\nYes, but see the comment above it. :-) It is intentional, but this option should have been off by default.\nAs a temporary solution you can \"blackbox\" script in Chrome Dev Tools: !\nYou should also be able to go to Components tab, press Settings gear, add checkbox to Break on Warning, then do this again, and remove the checkbox as a temporary workaround.\nI'll keep it open until we cut a release\nThanks\nI've submitted a fix to Chrome addons. It should appear there in a few hours. If it doesn't work after updating to 4.8.1, try to clear your local storage (). I can't figure out how to submit it to FF store because something in our process has changed. So will be able to help us out there when he wakes up. :-)\nHere's a step-by-step instruction for how to work around it while the fix is pending review: the Settings gear icon in the upper right corner <img width=\"1161\" alt=\"Screenshot 2020-07-10 at 14 39 06\" src=\"https://user-\"the Debugging tab <img width=\"1275\" alt=\"Screenshot 2020-07-10 at 14 39 13\" src=\"https://user-\"the checkmark next to Break on Warnings <img width=\"1273\" alt=\"Screenshot 2020-07-10 at 14 39 20\" src=\"https://user-\"the checkmark next to Break on Warnings <img width=\"1286\" alt=\"Screenshot 2020-07-10 at 14 39 25\" src=\"https://user-\"Now reload the page and you shouldn't be bothered by it.\nPlease refrain from \"same\" comments unless you have something new to say. They are not helpful and obscure the workaround ().\nUpdate: The fix has been published to NPM as 4.81 The updated extension (with fix) is live for Firefox The updated extension is pending for Chrome Edge is still providing the previous version 4.7 (but an updated 4.8.1 is also pending for review)\nWe'll keep this issue open until the fix has been deployed on Chrome, but I'm going to lock it to prevent +1\n1 is live in Chrome store now too, so I'm going to close this.", "positive_passages": [{"docid": "doc-en-react-1acf6ecf78e5bfcee6058e14abecb4c6340c62dcfda74a31f238aa9dd5f8fc0f", "text": "return JSON.parse(raw); } } catch (error) {} <del> return true; </del> <ins> return false; </ins> } export function setBreakOnConsoleErrors(value: boolean): void {", "commid": "react_pr_19309"}], "negative_passages": []} | |
| {"query_id": "q-en-react-cc16ba36f35cc025bb469eac20ac2f54da1e599001ebc016dbddc59e8b26d0ea", "query": "Describe what you were doing when the bug occurred: on commits greater than 3s through the commits doing a next next Please do not remove the text below this line DevTools version: 4.10.1- Call stack: at updateTree (chrome-) at getCommitTree (chrome-) at ProfilingCacheProfilingCache.getCommitTree (chrome-) at CommitFlamegraphAutoSizer (chrome-) at Hh (chrome-) at qi (chrome-) at mk (chrome-) at lk (chrome-) at kk (chrome-) at ck (chrome-) Component stack: at CommitFlamegraphAutoSizer (chrome-) at div at div at div at SettingsModalContextController (chrome-) at ProfilerProfiler (chrome-) at ErrorBoundaryErrorBoundary (chrome-) at PortaledContent (chrome-) at div at div at ProfilerContextController (chrome-) at TreeContextController (chrome-) at SettingsContextController (chrome-) at ModalDialogContextController (chrome-) at DevToolsDevTools (chrome-)\nCan you reliably reproduce this? If so, can you please share a repro case with us? (The bug is unlikely to be fixed without out.)\nShould I be providing the profiler json? Because using a recording profiler json or the use case, I mentioned above, it reproduces always. Or are you looking for a repository where this can be reproduced?\nAh, sorry my original request was unclear. No, profiler JSON would likely just show that an element is indeed missing. A repro case (where I can run the code, see where/how/why DevTools misses the element) is what I need to fix.\nArgh. So this is going to sound weird. I have a project where I can reproduce this, and I can do that always (see the date @ screenshot) but I can't ship it out due to a lot of internal tooling. So, I tried a similar use-case in my and I cannot it reproduce in that . I'll try some more and see if I can reproduce it in my personal project. The image below is from the project which I can't ship !\nI would be willing to sign an NDA or similar agreement if that would help. Otherwise, it would be super helpful if you were able to reduce it to something that you could ship. (Maybe you could start with your full app and remove things until you get to the smallest case that repros the bug? Then you could share just that?)\nFriendly ping. Any update or chance of one?\nHey try the below: Use this repo . The movie attached should help w/ repro steps. I also left some silly comments in - if you wanna try those out as well (somehow I feel they contribute to this trace - I could be wrong there). I haven't experimented much w/ the different yarn, node and npm versions, but below the ones which kinda did it. https://user-\nThank you for the repro! Holiday time so I might not take a look right away, but I'll try to look soonish.\nI knew there will be so many edge cases for these unfound fiber errors Anyway, based on repro, the problem (for this case) is that there's a error thrown I think by the recursive function due to the big number of elements that it needs to mount. I reproduced it in . Here's the steps to reproduce it: profiling Show button Hide button profiling\nThat's good insight. Can confirm this on my side as well, (though only if I disable the host component filter). My intuition when writing DevTools was that it would be very uncommon for apps to have React trees deep or wide enough that the recursive function (or similar functions, e.g. ) would run out of stack. I think that's true, but given how large the user base is I guess it makes sense that it happens sometimes. I took a stab at rewriting the recursive methods in the backend/renderer in but didn't get them all (, , , ) because it would have been a big change and would make the code harder to read. Maybe worth picking back up and finishing that effort. Anyone interested? The good news is, DevTools has decent unit test coverage.\nHi I may not be able to start till next week, but I'd like to give it a shot if you're cool with it\nSounds great Keep me posted.\nFriendly ping on this. Had the same issue multiple times and fallback to console log debugging\nCircling back around to this. Using the excellent repro steps () shared by I can repro this faster if I change the default items (in ) from to . Then just loading the app, I notice the following error (in the console): If I ignore this error and profile anyway: the number of list items from 5,000 -0 several errors (in the DevTools extension console, likely caused by the stack overflow above): profiling an error now in DevTools UI (related to the previous errors): So the underlying cause here, as pointed out by is the original stack overflow error.\nConverting all of the recursive methods in DevTools to be iterative would be a bit lift but I think I can fix this particular case by iterating over siblings rather than recursing. I'll post a PR shortly.", "positive_passages": [{"docid": "doc-en-react-d881ebe0e86edb4dcf13d68a1ff2b35976f94915d867ded28b73253b220afacf", "text": "} function mountFiberRecursively( <del> fiber: Fiber, </del> <ins> firstChild: Fiber, </ins> parentFiber: Fiber | null, traverseSiblings: boolean, traceNearestHostComponentUpdate: boolean, ) { <del> if (__DEBUG__) { debug('mountFiberRecursively()', fiber, parentFiber); } </del> <ins> // Iterate over siblings rather than recursing. // This reduces the chance of stack overflow for wide trees (e.g. lists with many items). let fiber: Fiber | null = firstChild; while (fiber !== null) { if (__DEBUG__) { debug('mountFiberRecursively()', fiber, parentFiber); } </ins> <del> // If we have the tree selection from previous reload, try to match this Fiber. // Also remember whether to do the same for siblings. const mightSiblingsBeOnTrackedPath = updateTrackedPathStateBeforeMount( fiber, ); </del> <ins> // If we have the tree selection from previous reload, try to match this Fiber. // Also remember whether to do the same for siblings. const mightSiblingsBeOnTrackedPath = updateTrackedPathStateBeforeMount( fiber, ); </ins> <del> const shouldIncludeInTree = !shouldFilterFiber(fiber); if (shouldIncludeInTree) { recordMount(fiber, parentFiber); } </del> <ins> const shouldIncludeInTree = !shouldFilterFiber(fiber); if (shouldIncludeInTree) { recordMount(fiber, parentFiber); } </ins> <del> if (traceUpdatesEnabled) { if (traceNearestHostComponentUpdate) { const elementType = getElementTypeForFiber(fiber); // If an ancestor updated, we should mark the nearest host nodes for highlighting. if (elementType === ElementTypeHostComponent) { traceUpdatesForNodes.add(fiber.stateNode); traceNearestHostComponentUpdate = false; </del> <ins> if (traceUpdatesEnabled) { if (traceNearestHostComponentUpdate) { const elementType = getElementTypeForFiber(fiber); // If an ancestor updated, we should mark the nearest host nodes for highlighting. if (elementType === ElementTypeHostComponent) { traceUpdatesForNodes.add(fiber.stateNode); traceNearestHostComponentUpdate = false; } </ins> } <del> } // We intentionally do not re-enable the traceNearestHostComponentUpdate flag in this branch, // because we don't want to highlight every host node inside of a newly mounted subtree. } </del> <ins> // We intentionally do not re-enable the traceNearestHostComponentUpdate flag in this branch, // because we don't want to highlight every host node inside of a newly mounted subtree. } </ins> <del> const isSuspense = fiber.tag === ReactTypeOfWork.SuspenseComponent; if (isSuspense) { const isTimedOut = fiber.memoizedState !== null; if (isTimedOut) { // Special case: if Suspense mounts in a timed-out state, // get the fallback child from the inner fragment and mount // it as if it was our own child. Updates handle this too. const primaryChildFragment = fiber.child; const fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null; const fallbackChild = fallbackChildFragment ? fallbackChildFragment.child : null; if (fallbackChild !== null) { mountFiberRecursively( fallbackChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate, ); </del> <ins> const isSuspense = fiber.tag === ReactTypeOfWork.SuspenseComponent; if (isSuspense) { const isTimedOut = fiber.memoizedState !== null; if (isTimedOut) { // Special case: if Suspense mounts in a timed-out state, // get the fallback child from the inner fragment and mount // it as if it was our own child. Updates handle this too. const primaryChildFragment = fiber.child; const fallbackChildFragment = primaryChildFragment ? primaryChildFragment.sibling : null; const fallbackChild = fallbackChildFragment ? fallbackChildFragment.child : null; if (fallbackChild !== null) { mountFiberRecursively( fallbackChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate, ); } } else { let primaryChild: Fiber | null = null; const areSuspenseChildrenConditionallyWrapped = OffscreenComponent === -1; if (areSuspenseChildrenConditionallyWrapped) { primaryChild = fiber.child; } else if (fiber.child !== null) { primaryChild = fiber.child.child; } if (primaryChild !== null) { mountFiberRecursively( primaryChild, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate, ); } </ins> } } else { <del> let primaryChild: Fiber | null = null; const areSuspenseChildrenConditionallyWrapped = OffscreenComponent === -1; if (areSuspenseChildrenConditionallyWrapped) { primaryChild = fiber.child; } else if (fiber.child !== null) { primaryChild = fiber.child.child; } if (primaryChild !== null) { </del> <ins> if (fiber.child !== null) { </ins> mountFiberRecursively( <del> primaryChild, </del> <ins> fiber.child, </ins> shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate, ); } } <del> } else { if (fiber.child !== null) { mountFiberRecursively( fiber.child, shouldIncludeInTree ? fiber : parentFiber, true, traceNearestHostComponentUpdate, ); } } // We're exiting this Fiber now, and entering its siblings. // If we have selection to restore, we might need to re-activate tracking. updateTrackedPathStateAfterMount(mightSiblingsBeOnTrackedPath); </del> <ins> // We're exiting this Fiber now, and entering its siblings. // If we have selection to restore, we might need to re-activate tracking. updateTrackedPathStateAfterMount(mightSiblingsBeOnTrackedPath); </ins> <del> if (traverseSiblings && fiber.sibling !== null) { mountFiberRecursively( fiber.sibling, parentFiber, true, traceNearestHostComponentUpdate, ); </del> <ins> fiber = traverseSiblings ? fiber.sibling : null; </ins> } }", "commid": "react_pr_21377"}], "negative_passages": []} | |
| {"query_id": "q-en-react-59a86245ac6304729137cee72ac08cdb53a38fe659832e836ae06e38730d4cc3", "query": "<!-- Please answer both questions below before submitting this issue. --Please provide a link to the URL of the website (if it is public), a CodeSandbox () example that reproduces the bug, or a project on GitHub that we can checkout and run locally. If possible, please describe how to reproduce this bug on the website or app mentioned above: <!-- FILL THIS IN --<!-- FILL THIS IN --<!-- FILL THIS IN --<!---------------------------------------------------<!-- Please do not remove the text below this line --<!---------------------------------------------------DevTools version: 4.13.1- Call stack: at chrome- at (chrome-) at chrome- at listener (chrome-) Component stack: (none) GitHub URL search query:\nHi I'm sorry you ran into this problem Unfortunately, it doesn't look like this issue has enough info for one of us to reproduce it though. This means that it's going to be very hard for us to fix. Please help us by providing a link to a CodeSandbox (), a repository on GitHub, or a minimal code example that reproduces the problem. (Screenshots or videos can also be helpful if they help provide context on how to repro the bug.) Here are some tips for providing a minimal example:\nI am also having this bug\nSee the comment above please :) Repro is needed.\nThis happened to me, the node wasn't appearing in the Components tree and I was getting this error. The problem was that my attribute was way too long\n! suddenly having this issue right now. I thought it was because of my commits, but changing to another old branch just give the same errors. it was working just fine yesterday, don't know why. maybe due to the devtools update or something? btw I'm on react 16.8.6, react devtools 4.13.3 (5/19/2021)\nTry updating to the latest release (4.13.4) just to rule anything out. But if you're still seeing the issue, then we still need a repro case.\nat first the bug still persists. with same error log. then I retried close the devtools and opened it again (I think I actually have done this as well before) then somehow it works now. the error log still shows up but at least now all components are showing on the devtools, and that's all I need. in addition, I found this ! and I was trying to hide that component (which has no recent changes on it) to see whether it has any impact. or any component that last showing on the devtools. but for now, that'll be all. thank you for responding\nI appreciate the extra information, but this isn't a description that I can use to reproduce (and fix) the bug. I need an actual website (or code) that I can run along with instructions (like \"do this, then this\") so I can see the bug.\nThere are some simple code could help reproduce. You could try following code sandbox link. The reproduce steps are: \"Do not\" open develop panel. to develop panel and go to react dev tab. Errors was shown. I guess it's kind of race condition. When I change the component order such as It will work perfect. Ps: brief explain what component do. The PageLoadProgressHandler will dispatch float element to PopupPool.\nExcellent! Thank you, Super interesting that this bug only occurs if you wait to open DevTools until after the page has loaded.\nI think it is because only have two components, I have two sites, one it will always happen, another will random happen. or maybe code-sandbox do some strange things.\nThis is interesting. The reason DevTools throws is that the Fiber's owner (the attribute) points to a Fiber that hasn't been mounted yet. That seems unexpected. This repro is just a wrapper around two NPM packages. Where's the source code for these packages? :D Edit I found it, although there's a lot of indirection here_. Tracing one package which imports another which imports another. Would be helpful if it were flattened but I guess I can always step through the bundled source.\nPopupPool: PageLoadProgressHandler: Good luck... XD.\nInterestingly, if I copy the , , and source files into the sandbox (and only change the import statement in ) the bug goes away. That's surprising.\nI wonder if I'm running slightly different code? The debug log shows a slightly different tree structure. Is the version of the source you linked me to the same as the one the Sandbox points to in NPM, Edit Looks like the repro is using 0.18.8 (released a couple of months ago) but the latest NPM release is 0.11.1. That being said, it doesn't look like the files that are being imported have changed (at least not in source) so I'm still not sure what's up.\nI change two main components to hook style then get better performance, it reduce the error happen, but I still could get error. Some error is happen after component render done and open the panel same behavior with pervious. I'll log my changes in following issue ticket.\nWould be nice to get a smaller reproduction of this issue (all of the code in one project, rather than spread across many NPM packages). That's what I was trying to do with moving the source but then the bug goes away b'c the code seems to be different. I noticed one potential difference being the indirection but I'm not sure how likely that is to be related.\nLooking at the error while debugging, it looks like the , then either renders it or dispatches a popup event to show it. I'm not sure why (too sleepy to think it through maybe) but sometimes seems to be mounting before_ has, which goes against an assumption in DevTools. Will dig back in tomorrow.\nI really appreciate the repro case, but there are so many layers of indirection between the various NPM packages being used to dynamically create the components. It's difficult to trace through. I'm going to hand this issue to you and ask for a smaller repro case. (Without 10+ NPM projects that each require each other.) Is this something you can help with? Edit I fixed this () but the test case I is not great since it relies on unsupported side effects to trigger the problem case. I'd still love to get a smaller repro so I can (1) be sure I fully fixed the problem and (2) add a regression case so it doesn't get re-introduced.\nBugfix released as\nthank you fixed on version 4.13.5\nThanks your effort. Your fixed also be success from my side.", "positive_passages": [{"docid": "doc-en-react-b79fd4faf80d63764211b4876b9981357b248a77ab807f7d175019e974fdb1ab", "text": "expect(store).toMatchSnapshot('2: add host nodes'); }); <ins> // This test is not the same cause as what's reported on GitHub, // but the resulting behavior (owner mounting after descendant) is the same. // Thec ase below is admittedly contrived and relies on side effects. // I'mnot yet sure of how to reduce the GitHub reported production case to a test though. // See https://github.com/facebook/react/issues/21445 it('should handle when a component mounts before its owner', () => { const promise = new Promise(resolve => {}); let Dynamic = null; const Owner = () => { Dynamic = <Child />; throw promise; }; const Parent = () => { return Dynamic; }; const Child = () => null; const container = document.createElement('div'); act(() => ReactDOM.render( <> <React.Suspense fallback=\"Loading...\"> <Owner /> </React.Suspense> <Parent /> </>, container, ), ); expect(store).toMatchInlineSnapshot(` [root] <Suspense> \u25be <Parent> <Child> `); }); </ins> describe('collapseNodesByDefault:false', () => { beforeEach(() => { store.collapseNodesByDefault = false;", "commid": "react_pr_21562"}], "negative_passages": []} | |
| {"query_id": "q-en-react-59a86245ac6304729137cee72ac08cdb53a38fe659832e836ae06e38730d4cc3", "query": "<!-- Please answer both questions below before submitting this issue. --Please provide a link to the URL of the website (if it is public), a CodeSandbox () example that reproduces the bug, or a project on GitHub that we can checkout and run locally. If possible, please describe how to reproduce this bug on the website or app mentioned above: <!-- FILL THIS IN --<!-- FILL THIS IN --<!-- FILL THIS IN --<!---------------------------------------------------<!-- Please do not remove the text below this line --<!---------------------------------------------------DevTools version: 4.13.1- Call stack: at chrome- at (chrome-) at chrome- at listener (chrome-) Component stack: (none) GitHub URL search query:\nHi I'm sorry you ran into this problem Unfortunately, it doesn't look like this issue has enough info for one of us to reproduce it though. This means that it's going to be very hard for us to fix. Please help us by providing a link to a CodeSandbox (), a repository on GitHub, or a minimal code example that reproduces the problem. (Screenshots or videos can also be helpful if they help provide context on how to repro the bug.) Here are some tips for providing a minimal example:\nI am also having this bug\nSee the comment above please :) Repro is needed.\nThis happened to me, the node wasn't appearing in the Components tree and I was getting this error. The problem was that my attribute was way too long\n! suddenly having this issue right now. I thought it was because of my commits, but changing to another old branch just give the same errors. it was working just fine yesterday, don't know why. maybe due to the devtools update or something? btw I'm on react 16.8.6, react devtools 4.13.3 (5/19/2021)\nTry updating to the latest release (4.13.4) just to rule anything out. But if you're still seeing the issue, then we still need a repro case.\nat first the bug still persists. with same error log. then I retried close the devtools and opened it again (I think I actually have done this as well before) then somehow it works now. the error log still shows up but at least now all components are showing on the devtools, and that's all I need. in addition, I found this ! and I was trying to hide that component (which has no recent changes on it) to see whether it has any impact. or any component that last showing on the devtools. but for now, that'll be all. thank you for responding\nI appreciate the extra information, but this isn't a description that I can use to reproduce (and fix) the bug. I need an actual website (or code) that I can run along with instructions (like \"do this, then this\") so I can see the bug.\nThere are some simple code could help reproduce. You could try following code sandbox link. The reproduce steps are: \"Do not\" open develop panel. to develop panel and go to react dev tab. Errors was shown. I guess it's kind of race condition. When I change the component order such as It will work perfect. Ps: brief explain what component do. The PageLoadProgressHandler will dispatch float element to PopupPool.\nExcellent! Thank you, Super interesting that this bug only occurs if you wait to open DevTools until after the page has loaded.\nI think it is because only have two components, I have two sites, one it will always happen, another will random happen. or maybe code-sandbox do some strange things.\nThis is interesting. The reason DevTools throws is that the Fiber's owner (the attribute) points to a Fiber that hasn't been mounted yet. That seems unexpected. This repro is just a wrapper around two NPM packages. Where's the source code for these packages? :D Edit I found it, although there's a lot of indirection here_. Tracing one package which imports another which imports another. Would be helpful if it were flattened but I guess I can always step through the bundled source.\nPopupPool: PageLoadProgressHandler: Good luck... XD.\nInterestingly, if I copy the , , and source files into the sandbox (and only change the import statement in ) the bug goes away. That's surprising.\nI wonder if I'm running slightly different code? The debug log shows a slightly different tree structure. Is the version of the source you linked me to the same as the one the Sandbox points to in NPM, Edit Looks like the repro is using 0.18.8 (released a couple of months ago) but the latest NPM release is 0.11.1. That being said, it doesn't look like the files that are being imported have changed (at least not in source) so I'm still not sure what's up.\nI change two main components to hook style then get better performance, it reduce the error happen, but I still could get error. Some error is happen after component render done and open the panel same behavior with pervious. I'll log my changes in following issue ticket.\nWould be nice to get a smaller reproduction of this issue (all of the code in one project, rather than spread across many NPM packages). That's what I was trying to do with moving the source but then the bug goes away b'c the code seems to be different. I noticed one potential difference being the indirection but I'm not sure how likely that is to be related.\nLooking at the error while debugging, it looks like the , then either renders it or dispatches a popup event to show it. I'm not sure why (too sleepy to think it through maybe) but sometimes seems to be mounting before_ has, which goes against an assumption in DevTools. Will dig back in tomorrow.\nI really appreciate the repro case, but there are so many layers of indirection between the various NPM packages being used to dynamically create the components. It's difficult to trace through. I'm going to hand this issue to you and ask for a smaller repro case. (Without 10+ NPM projects that each require each other.) Is this something you can help with? Edit I fixed this () but the test case I is not great since it relies on unsupported side effects to trigger the problem case. I'd still love to get a smaller repro so I can (1) be sure I fully fixed the problem and (2) add a regression case so it doesn't get re-introduced.\nBugfix released as\nthank you fixed on version 4.13.5\nThanks your effort. Your fixed also be success from my side.", "positive_passages": [{"docid": "doc-en-react-2ecdf99ae0b477493332383441b1b8e37fd7275f72a0cb086c37af80dd52bf6b", "text": "const elementType = getElementTypeForFiber(fiber); const {_debugOwner} = fiber; <del> const ownerID = _debugOwner != null ? getFiberIDThrows(_debugOwner) : 0; </del> <ins> // Ideally we should call getFiberIDThrows() for _debugOwner, // since owners are almost always higher in the tree (and so have already been processed), // but in some (rare) instances reported in open source, a descendant mounts before an owner. // Since this is a DEV only field it's probably okay to also just lazily generate and ID here if needed. // See https://github.com/facebook/react/issues/21445 const ownerID = _debugOwner != null ? getOrGenerateFiberID(_debugOwner) : 0; </ins> const parentID = parentFiber ? getFiberIDThrows(parentFiber) : 0; const displayNameStringID = getStringID(displayName);", "commid": "react_pr_21562"}], "negative_passages": []} | |
| {"query_id": "q-en-react-fd87b854403fc050a7cb1769453be19dbd48a0b06a22d5f51f438487fbe8cd34", "query": "DevTools named hook parsing logic currently matches AST nodes using the original line number: But this may not be sufficient, as mentioned in comment\nWhile we're on the subject: Column numbers in particular are where a lot of inconsistencies between tools/engines' representations occur and off-by-one errors creep in. V8, SpiderMonkey, JSC all use 1-based lines and 1-based columns in . Hermes follows the other engines for the most part but has its own thing going on for bytecode addresses (printed similarly to columns but 0-based). See the in React Native. VS Code uses 1-based lines and 1-based columns. The library (at least AFAIK from older versions) uses 1-based lines and 0-based columns in its API. ESTree/Babel ASTs use 1-based lines and 0-based columns. The Chrome DevTools protocol uses 0-based lines and 0-based columns. So I suspect we have an incorrect conversion already - we should fix it and signpost assumptions/conversions more clearly.\nReopening to address this follow up comment from", "positive_passages": [{"docid": "doc-en-react-6c04309ecc806d336b79c1f52650324556e50672ebaa62fa9525afe9ecf3d1e2", "text": "return false; } <ins> // Column numbers are representated differently between tools/engines. // Error.prototype.stack columns are 1-based (like most IDEs) but ASTs are 0-based. // // In practice this will probably never matter, // because this code matches the 1-based Error stack location for the hook Identifier (e.g. useState) // with the larger 0-based VariableDeclarator (e.g. [foo, setFoo] = useState()) // so the ranges should always overlap. // // For more info see https://github.com/facebook/react/pull/21833#discussion_r666831276 column -= 1; </ins> if ( (line === start.line && column < start.column) || (line === end.line && column > end.column)", "commid": "react_pr_21865"}], "negative_passages": []} | |
| {"query_id": "q-en-react-fd87b854403fc050a7cb1769453be19dbd48a0b06a22d5f51f438487fbe8cd34", "query": "DevTools named hook parsing logic currently matches AST nodes using the original line number: But this may not be sufficient, as mentioned in comment\nWhile we're on the subject: Column numbers in particular are where a lot of inconsistencies between tools/engines' representations occur and off-by-one errors creep in. V8, SpiderMonkey, JSC all use 1-based lines and 1-based columns in . Hermes follows the other engines for the most part but has its own thing going on for bytecode addresses (printed similarly to columns but 0-based). See the in React Native. VS Code uses 1-based lines and 1-based columns. The library (at least AFAIK from older versions) uses 1-based lines and 0-based columns in its API. ESTree/Babel ASTs use 1-based lines and 0-based columns. The Chrome DevTools protocol uses 0-based lines and 0-based columns. So I suspect we have an incorrect conversion already - we should fix it and signpost assumptions/conversions more clearly.\nReopening to address this follow up comment from", "positive_passages": [{"docid": "doc-en-react-0c1cb0c26d52930b9ad004067452ec04c302d940bc79c996eaa9bbbed899b8c6", "text": "line: lineNumber, // Column numbers are representated differently between tools/engines. <ins> // Error.prototype.stack columns are 1-based (like most IDEs) but ASTs are 0-based. </ins> // For more info see https://github.com/facebook/react/issues/21792#issuecomment-873171991 column: columnNumber - 1, });", "commid": "react_pr_21865"}], "negative_passages": []} | |
| {"query_id": "q-en-react-d05fc667b4507518b71c730121247705b438be43f68d8626c48a8cea2988e243", "query": "Currently the CHANGELOG shows 4.3.0 as the latest version of , but at least on , there is not a 4.4.0. React version: n/a Changelog to version on Link to code example: n/a No 4.4.0 explanation in 0 explanation in\nI think 4.4.0 was essentially a no-op release to correspond with React 18 release (though cc to confirm). Looking at what's changed in the package between the 4.3.0 release and Monday's 4.4.0 \"release\" I see: I believe this is the same thing as happened with the ESLint 4.2.0 release and React 17. I believe the \"fix\" here would be to just add a 4.4.0 release to the CHANGELOG that notes this.\nThanks so much That definitely seems like the right fix!", "positive_passages": [{"docid": "doc-en-react-013979c404fb59396054817073a8bbc013f54efd66978ad1f560eb75dae2d293", "text": "<ins> ## 4.4.0 * No changes, this was an automated release together with React 18. </ins> ## 4.3.0 * Support ESLint 8. ([@MichaelDeBoey](https://github.com/MichaelDeBoey) in [#22248](https://github.com/facebook/react/pull/22248))", "commid": "react_pr_24234"}], "negative_passages": []} | |
| {"query_id": "q-en-react-4293f9d76558eedc06f8ff39a1f5d5052360ed368bed3e0a20d0309db2c26b3d", "query": "<!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --React version: main branch \"\" in \" and its \" <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --The page is 404. The page should exist.\nFixed by", "positive_passages": [{"docid": "doc-en-react-7ea35d2e124dc8e026573763d78655a2d98ece529ec7c474960b2b755f8cb79b", "text": "The examples in the React repository are declared a bit differently than a third-party renderer would be. In particular, the `HostConfig` object mentioned above is never explicitly declared, and instead is a *module* in our code. However, its exports correspond directly to properties on a `HostConfig` object you'd need to declare in your code: * [React ART](https://github.com/facebook/react/blob/main/packages/react-art/src/ReactART.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-art/src/ReactARTHostConfig.js) <del> * [React DOM](https://github.com/facebook/react/blob/main/packages/react-dom/src/client/ReactDOM.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-dom/src/client/ReactDOMHostConfig.js) </del> <ins> * [React DOM](https://github.com/facebook/react/blob/main/packages/react-dom/src/client/ReactDOM.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-dom-bindings/src/client/ReactDOMHostConfig.js) </ins> * [React Native](https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactNativeRenderer.js) and its [host config](https://github.com/facebook/react/blob/main/packages/react-native-renderer/src/ReactNativeHostConfig.js) If these links break please file an issue and we\u2019ll fix them. They intentionally link to the latest versions since the API is still evolving. If you have more questions please file an issue and we\u2019ll try to help!", "commid": "react_pr_25788"}], "negative_passages": []} | |
| {"query_id": "q-en-react-5fd32d4dab9f13ab64fd6f062ba1cf0423d08321b95c22eb8df51d4924e5c8df", "query": "Can't send ArrayBuffer to Server Action despite saying that you can. I'm not sure if this is an error or my part or the documentation. I retrieved the arrayBuffer from file of formData, then pass it through the parameter of the Server Action. It seems like it doesn't get sent to the server because it can't be parsed due to ArrayBuffer being serializable but not iterable. However this is somewhat confusing because you can attach File in FormData in the form of Blob and send it to the Server Action. I understand that FormData is but I'm not sure I understand why it can't be done the same with ArrayBuffer. I understand that I can just pass the FormData to send files but In my case I needed to transform the Files first before uploading and it ends up with a Blob. <!-- Please provide a clear and concise description of what the bug is. Include screenshots if needed. Please test using the latest version of the relevant React packages to make sure your issue has not already been fixed. --React version: form, input, submit button, and also onSubmit function using Client Action the arrayData from the formData then pass it to server action <!-- Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Issues without reproduction steps or code examples may be immediately closed as not actionable. --Link to code example: <!-- Please provide a CodeSandbox (), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem. You may provide a screenshot of the application if you think it is relevant to your bug report. Here are some tips for providing a minimal example: -- Throws client-side error ArrayBuffer gets sent to the server The documentation: <img width=\"583\" alt=\"image\" src=\"\"Please let me know if I fail to understand the documentation or if it's something wrong in the documentation\nI'm having the same issue.\nWokraround: I've tested multiple react/nextjs version combinations and now found working one. For me it's nextjs 13.5.6 and react 18.2.0. Reply pls when you try it out)\nI will test. I'm using and\nThe workaround i have for now is to wrap the data with FormData first and append the file before sending it to the server action\nIt seems that shipping as parameters of the server action is enabled, but returning from the server action is still not enabled.\nas per the documentation, that is the intended behavior\nThey're supported as return values in Server Actions in React's Experimental release channel. Sending to Server Actions is currently not supported but we want to achieve parity eventually. I'll file a PR updating the docs accordingly.\nWill be supported by\nThis issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, \"bump\"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!\nClosing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!", "positive_passages": [{"docid": "doc-en-react-7433a0a21625d38bf89325fcc98d9742c4cc83acae3dad64cff7184d0e5ede32", "text": "<del> /** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. * * @providesModule ReactNativeGlobalInteractionHandler * @flow */ 'use strict'; var InteractionManager = require('InteractionManager'); // Interaction handle is created/cleared when responder is granted or // released/terminated. var interactionHandle = null; var ReactNativeGlobalInteractionHandler = { onChange: function(numberActiveTouches: number) { if (numberActiveTouches === 0) { if (interactionHandle) { InteractionManager.clearInteractionHandle(interactionHandle); interactionHandle = null; } } else if (!interactionHandle) { interactionHandle = InteractionManager.createInteractionHandle(); } }, }; module.exports = ReactNativeGlobalInteractionHandler; </del>", "commid": "react_pr_6588"}], "negative_passages": []} | |