| {"_id":"doc-en-react-c106a437ddd3bd1957c6502f10dcab059cffc9005b0db8685ba1254d6e535341","title":"","text":"I'm using tag to generate client certificates and I'm missing challenge and keytype attributes.\nIt would be cool if React gives us the opportunity to use different syntax for attrs and props: And may be: There would be no need to know what tags React supporting.\nThere's more planned to alleviate the issues around unknown elements and properties, but we're not there yet. We have no plans on to use different syntax. Adding the additional attributes here seems totally reasonable.\nWill try to take a stab at this. I assume this is as simple as adding those props to , and then adding tests. Is that correct or am I missing anything significant?\nIt's even easier than that since we don't really have tests for the attributes. But do actually test in a couple browsers that changing values across renders is reflected appropriately (usually the issues is property vs attribute).\nYou're quick, guys. Thanks in advance!\nBy 'across renders' you mean simply triggering a re-render (by changing the value)?\nYea. I usually just make a simple component with a button that toggles state so I can test with multiple values easily.\nGreat. Thx.\nI missed a detail in docs. Although, I don't need it, there's an additional attribute, keyparams, which is required with \"dsa\" and \"ec\" keytypes. See\nHave this working, though I'm not entirely clear if these should be , or . I wasn't able to deduce the meaning of these from the code. Is there someplace I can read up on these?\nThose are used to determine if we do or if we do when updating. means it doesn't matter and browsers should work with either. Currently we use properties in that case but we may switch that in the future. indicate that they must be set & removed as a property or an attribute.\nThanks. That makes sense. Had to use to get it to work properly across Chrome/FF/Safari. Your testing method great as well. Thx for your help"} | |
| {"_id":"doc-en-react-af6422597abfc3705e1e016cf37e5dbfbfdcf0923b24267ad3eb49d20f8d6064","title":"","text":"<!-- 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? In , the shallow renderer will set instance state in so the and will be the same in , which is different with the behavior of real rendering. 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: given below class component: render with ReactDOM, the will return true since will be the old value : In shallow renderer, the behavior is different: What is the expected behavior? ShallowRenderer should not set the instance state in getDeriveStateFromProps, or in the we have no way to compare it. Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? I have tested this in master branch and 16.3, both not work. By the way this problem is related to airbnb/enzyme . If it's recoginzed as a bug I can provide a PR in next several days."} | |
| {"_id":"doc-en-react-43bd8c935fcf00bee8061fadc9d53ee4ce08d7674cd1b756a95fad46456d6e25","title":"","text":"We need a way to test the output of a single level React component without resolving it all the way down to the bottom layer (whatever that is). I'm thinking something like this: Basically, this fix needs to go through the entire life-cycle of ReactCompositeComponent. It just needs to bail out whenever it would've continued rendering.\nReopened so that we can track the remaining features (refs etc.)\nWeird, I thought GitHub only closed issues if you used language like \"fixes #NNNN\", not if you simply mentioned the issue at all. Sorry about that.\nThe PR text included \"WIP to \"\nIs the rest (refs support) blocked by or can more work be done now?\nAny reason this doesn't support other than that it's not implemented yet? I was hoping to do something like\nthat's supposed to work. Can you post a minimal repro?\nHow do you do this? does not return an instance.\nIt works if I use so I think could just return that from . (I also have to shim because React expects it to be defined for some reason.)\nFinding this quite useful. But it has been a bit inconvenient to have among the children when an element is conditionally rendered.\nThe idea was to make the helpers ignore null which could help with that. Perhaps we could have return an iterable which traverses nested arrays and ignores null.\nReally? Allowing nulls was a change intentionally introduced a long time ago. In I have an implementation of toArray.\nAllowing empty children (null, undefined, boolean) was a controversial topic, where we eventually landed on null/boolean/undefined being passed through. That way you could explicitly treat an empty slot as something special. This landed very early on before we really started seeing pattern developing. However, IMO, we've seen that this leads to inconsistent implementations where null slots will break and is not possible to use. It is unclear whether a set of children allows nullable slots, and if they do, it is unclear what that means. For example, in a grid layout component, does an empty slot mean that there should be an empty column in the grid, or that it should be skipped? Therefore, a lot of our components end up with explicit null checks. Meaning boilerplate, and inconsistent behavior when they're forgotten."} | |
| {"_id":"doc-en-react-26f74882fe59ad2106ea606628fef442808db170983d47929460fee2f487ed92","title":"","text":"Therefore, I think the default should be to filter out nulls which is consistent with the behavior of the built-ins components. It is still possible to get access to the raw data if you have a different type of children in mind where empty slots is meaningful.\nHow should this work with the TestUtils functions. For example, this fails: I can't see any other info on mentioned at the start of this issue, is this what I'm missing? My end goal is simply to test that if I pass in 10 articles then 10 components get rendered. Any help would be awesome.\nHi David, the and functions are meant to be used with the output of , not shallow rendering. React doesn't currently provide a helper that will traverse trees for you. Your options for now are to describe the structure of the tree explicitly as in lines 4-5 of your example, or write your own helper module to find descendants you care about. hasn't been implemented yet. Refer to the for what's actually in React.\nCool, thanks for the reply I've returned to just using since the components I'm testing (and their children) don't have state/stores so don't really need mocking out anyway. One last (maybe stupid) question, what does mean?\nSo, I am trying to use Shallow Rendering and have it mostly only thing left I can’t figure out is the recommended way to mock events and how to get with events to pass. I've attempted to use the method directly from the in the test (). This seems dirty…is there a way to just say or something? I could post this on Stack Overflow, but I have had very little luck finding good information about Shallow Rendering online. If anyone has experience with shallow rendering and can give me some help you will be my hero... Source code: ! !\nIf I have an issue with shallow rendering, should I create a new issue, or post it here?\nNew issue please.\nyou might find that helps in providing higher-level assertions for the sort of thing you're doing there. In that particular case, I would avoid asserting on the event handler of the anchor in that test - but a different test would want to call to test the handler.\nSuper late reply, but \"scry\" is a fancy word for \"find\". I'm not sure why we don't just use \"find\"."} | |
| {"_id":"doc-en-react-74686185b37a0ea269ae4ac6ffd7ebf8062f5d897e5d70eb2610fd72d3a71db1","title":"","text":"Maybe to avoid confusion between the plural and singular forms, whose names would otherwise differ only by one \"s\".\nscry is because of legacy internal FB APIs. No reason.\nLike I'm keenly on the lookout for a way to correctly unit test event handling in React code. Is there any documentation that anyone could point me to? I've looked at but it didn't seem to have something that scratches my particular itch. Here's my scenario (cut down): Where Problem looks like this: I'd like to be able to assert that is wired up for my component but I'm at a loss as to how to do that....\nWhat you actually want is to assert that clicking interacts with the router. Pass in a fake context with a router mock (try Simon) then call Apologies for the brevity, on a phone.\nHi Thanks for responding. I'm not too clear on how to mock successfully when it comes to context. Digging through the source of I came up with this: However this dies a death with: Which makes me think I'm getting the context mocking wrong. Do you know how you successfully mock context with ? I'm using Jasmine (as you probably guessed!) I have a feeling I'm close...\nAre you using React 0.13? You're probably hitting the difference between parent & owner context. Skin deep has a wrapper that helps with this - there's a context example the test suite, but the short answer is to wrap your render in another function call and let skin deep set up the context. This problem should go away in 0.14\nI am using React 0.13, yes. If I port to 0.14 this issue should resolve? I might give that a crack if that's the case (it is in RC after all)\nProblems with the upgrade. I have raised . Will have to return to this later I think.\nI have written and as companion tools when testing with shallow rendering. It gives you the ability to diff on JSX strings rendered instead of React element objects.\nHi, I was wondering what was the state of: simulating events when using shallow rendering using refs when using shallow rendering How can we help make this happen if that's still planned?\nThis issue is pretty stale so I’ll close it."} | |
| {"_id":"doc-en-react-648b97e94c725256b26e1bd96a5fd371b8015ffce2e3e1a0a44a2263c4489568","title":"","text":"If there are specific features you miss in the shallow renderer please create new issues with proposals on how they should work. Note that we a new that is much more feature-complete."} | |
| {"_id":"doc-en-react-9306121422e93f6146586d22ff20af2d3e2d2860ed922937e70054809fe064b5","title":"","text":"reported the following issue on IRC: (Both on master and 4.0) The repro case is: 1) Render 2) Render 3) Render the same as 1) The div has its innerHTML empty instead of . I don't really know what's going on. can you guys look at it?\nOne other tidbit: this only seems to happen when the value is exactly the same in step 3 as it was in step 1. If it's different (i.e. ), things work as expected.\nWhat happens if you change step 2 to a instead of a ? It works, right?\nI just reduced the test case to 19 lines.\nyeah changing 2) to use a span works as expected\nIf anyone wants to look into this, the bug is probably here\nI cannot reproduce what you are seeing: It also bugs if I use a different string\nI'm not able to reproduce that particular behavior given this small repro case. The original code had several more layers... will keep trying.\nI know this is a very old issue but I had a similar problem and came across this. I found that this problem occurs when you do not add a property to the React component containing the property. So, does not seem to work reproducibly, whereas seems to. I think this could be related to React's diffing algorithm that might not properly treat a component with a statement if that component gets rerendered multiple times with different inner content. Just posting this here in case other people have the same issue and stumble upon this.\nthx you saved my day :-)\nSeems like the issue is back again. Thanks, solves the problem for me too.\nIf any of you can post a simple repro case showing the broken behavior here, I'd be happy to take a look at fixing it.\nTook me a while to repro, but here you go: (ugly, but demonstrates the issue well)\nThanks. This is the same issue as . No fix currently, but using the key as a workaround is fine and I'll see if we can fix this sometime.\nThanks that was giving me fits!\nIf anyone is still seeing issues on 0.14, please make a new issue with a simple repro case."} | |
| {"_id":"doc-en-react-2561d4a0be5f333acf881b6f80c1a973b0d2a5e9e6140ce5d6d62900271a0991","title":"","text":"I have this issue, but can't reproduce in a simple example - my original code is layered and I think that's the reason the real DOM doesn't reconcile. In the react debugger is looks as dangerouslySetInnerHTML has proper __html value, but it doesn't equeal to the innerHTML of the actual element. I used an extremely simple (and equally nasty) workaround. Writing it here just in case it will help someone:\nReading out will rarely give you what you put in because the browser does various kinds of normalization on it. If you can repro with a standalone example though I'm happy to take a look.\nwell, that's more like a control shot :-)\nLooks like the issue still exist in 16.4.1 when using on a tag, you cannot nest other or . issue is fixed by replacing the container with a\nIf you experience something similar three years later, and the original issue is closed, you can be sure it's a different unrelated issue. :-) Please file a new one. We don't keep track of closed issues so your feedback is unfortunately going into the void. When filing a new issue, please provide a reproducing example. when using dangerouslySetInnerHTML on a tag, you cannot nest other or This sounds like browsers work. You can't nest into . This is why React warns when you do it (except in which case React can't validate it)."} | |
| {"_id":"doc-en-react-512e76875da3b7a71346eeb963942c92d292dc79b671907e793003fa3dbd424a","title":"","text":"Describe what you were doing when the bug occurred: back to go back through the frames following a profile session. I think I got to zero and then clicked it again and then it errored Please do not remove the text below this line DevTools version: 4.8.2- Call stack: at getCommitTree (chrome-) at getCommitTree (chrome-) at getCommitTree (chrome-) at getCommitTree (chrome-) at getCommitTree (chrome-) at getCommitTree (chrome-) at getCommitTree (chrome-) at getCommitTree (chrome-) at getCommitTree (chrome-) at getCommitTree (chrome-) Component stack: at CommitRankedAutoSizer (chrome-) at div at div at div at SettingsModalContextController (chrome-) at ProfilerProfiler (chrome-) at ErrorBoundary (chrome-) at PortaledContent (chrome-) at div at div at ProfilerContextController (chrome-) at TreeContextController (chrome-) at SettingsContextController (chrome-) at ModalDialogContextController (chrome-) at DevToolsDevTools (chrome-)\nPlease how do I replicate this? I don't seem to be able to replicate it.\nsorry, I won't have time to create a mre. I was doing a recording on a site with a lot of components and a lot of frames in the recording. I ended up going to maybe frame 30 then clicking back rapidly to get back to 0 and I guess went to far or something. Feel free to close this, I thought that the logs might be enough and it was encouraging me to submit the issue.\nCan I have a look ?\nMaybe change this recursive function And use a loop going to correct the issue. If it is ok, i can work on it.\ncan you share how you were able to replicate the issue?\nI think for there to be a stack overflow from calling itself, it would need to have profiling data with thousands (?) of commits. This function only recurses (at most) once per commit when processing data, and then, too, only if you jump through commits you haven't yet processed (so 0 -N would recurse N times). That being said, it seems like we could also rewrite this function to be iterative without too much trouble. Done in PR !\nThat's quite possible actually. The issue I was trying to diagnose was high CPU usage on an app that has spreadsheet like functionality, i.e."} | |
| {"_id":"doc-en-react-a841d72b091db1489f8c73d5bb09a3b5a8e633cc5d8c4984fa6afb7df739d217","title":"","text":"lots of components so I was trying to see exactly what was taking all the CPU time. Thanks for the PR. Hopefully next time this crops up it will solve it.\nGreat Should be released sometime in the next few days."} | |
| {"_id":"doc-en-react-32151ac5f4d8d7fcb6b59730e1224ffe5f513940e4fe6d4c7eec610e94d11802","title":"","text":"<!-- 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: DevTools version 4.12.2- from within a React component where the last argument is typeof <!-- 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: The bug only happens when you make a change, so if you use the code sandbox link you need, open a new window, active dev tools, open the React dev tools and then uncomment line 5: only then will the error actually happen. I've located the culprit to this line of code And would offer the following change <!-- 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: --React DevTools is implicitly converting a Symbol to a string. React DevTools does not implicitly try to convert a Symbol to a string.\nThanks for the report. Also reproduced with DevTools version 4.12.3- in Chrome 90 In addition to fixing the bug, it would also be nice to guard against devtools failing so that the UI is unaffected if devtools is faulty. /cc\nYour the best, thanks for a quick turn around!"} | |
| {"_id":"doc-en-react-ec5ecfe108c5622ae0f0ce83ae6ca196a4c0778b1ab6d72b9b10da2f746acbc9","title":"","text":"Observed this on react This renders as . If you try to hydrate this you'll get the error: Text content did not match. Server: \"bc\" Client: \"b\".\nI suppose the bug here is that we do not separate from here but we should.\nReact has been released. Please update , , and (if you use it) to this version and let us know if it solved the issue! We’d appreciate if you could test before Monday when we plan to get out.\nEverything looks good on my end, thanks!"} | |
| {"_id":"doc-en-react-54830cbd0e807e9ec25aed786a1e0f731e3699add76f794c7e60bf706c749bf6","title":"","text":"This makes it basically unusable in any nontrivial project. While people shouldn't be using this in production, we should still fix this bug for newbies and people using it for hackathons.\nThis should be relatively easy. What should we do with inline tags?"} | |
| {"_id":"doc-en-react-303f5589a27626c8ed5d6f0f930b2b84163d1cdd0133511f0a90007b7a44f4fd","title":"","text":"When unmounting components like this: a memory leak happens because ReactMount.getID(node) puts DOM nodes back to nodeCache if they are not there.. just right after they were purged from cache. Here is what's happing when unmounting that example component: label component gets purged from nodeCache when ReactDOMInput component is going to unmount it calls this method: which contains this.getDOMNode() which iterates through the children of the Form element calling getID() on each of them.. which puts these elements back into the cache. So first they were purged and here they are all put back in cache causing a memory leak :( I'm playing with React just 3rd day so not sure of a way to correctly fix this issue\n(I took the liberty to edit your comment to add syntax highlighting)\nI can't reproduce this. With this diff applied, I loaded http://127.0.0.1:8000/examples/ballmer-peak/ in the console and checked -- it was empty. Am I misunderstanding?\nYes. You've missed one more user defined component in there.. Here you go:\nThanks, fixed in .\nThank you for fast fix :)\nThanks for the find/fix!"} | |
| {"_id":"doc-en-react-ca64118bf847d4660407dc0cfa80dc13393c771af4b88e26ffe9546e10663249","title":"","text":"Should those comment sections exist? I'd rather people come to IRC. Their questions are often neglected at the bottom of a doc page.\n:+1: for shutting down comments\n+1\n:+1:"} | |
| {"_id":"doc-en-react-7e215142cfee41f3a5c9f3a4523ae6786642b4cde53fcef8da4414036dde1206","title":"","text":"Someone had the trouble in IRC about it. Edit: changed the subject from \"document it\" to \"support it\", because the documentation issue is already at .\nBetter yet, support it!\nYeah, is there a particular reason it's not supported?\nCurious if you've seen the . It's automatically injected into React by default, so you can use it today. IMHO it's (much) better than . (I suppose we could support just for the sake of completeness, but I thought I'd just make sure you guys were aware of .)\nWe discussed this for a bit on IRC -- was just confused that silently didn't work whereas other events did -- perhaps adding more documentation () will fix the problem too but it seems like we might as well add for completeness. (I agree that enter/leave are much more useful and suggested that over/out are likely missing simply because no one has needed them!)\nAgree - I believe there are a few extra allocations (not-pooled) occuring in the event system already today. I'd love to track those down before adding more mouse-move event allocations. If you open the memory profiler in Chrome and move the mouse around, you'll see memory being allocated (and then properly freed of course) but if we use es everywhere, we should be flat. That would make me much more comfortable with adding to . Edit: Just checked out - we already have which fires way more frequently than would so it's probably not such a big deal to add - though we really should get rid of all additional allocations in the event path.\nJust started to look a little bit into the allocations here. Redefining trapBubbledEvent in ReactEventEmitter with: still shows allocations in the Chrome memory timeline view, so I'm not convinced that there's anything we can do here? (Replacing trapBubbledEvent itself with a noop makes the allocations go away. simply calls addEventListener.)\nI am pretty sure we have done all we can here -- at least I think we've tracked down every callsite where PooledClass would have helped us. I updated our recast transforms to log every syntax construct that would cause an obvious allocation and couldn't find anything. I was thinking maybe there was an array slice or a bind() in there, but experiment shows that this is not the case."} | |
| {"_id":"doc-en-react-ac434d767083ac836e19c967390cf16739cdb96c2a1d7993c7c103db6b357686","title":"","text":"(I didn't verify that we don't have more allocations than the empty-function case; I don't know of a good way to do so.)\nI might be misinformed, but isn't there quite a difference in use cases between mouseenter and mouseover events? Here's a theoretical (non-react) example working with some hover states for nested elements: I tried to apply the above concept in react (with nested components) using onMouseEnter instead, but it obviously fails because it's only triggered once on the top-most element. Moving into a child element and back has no effect. Maybe there's a better approach for this in react altogether?\nIf you render the child hierarchy with React, you can listen to on each child element you are interested in instead of using event bubbling. It is cheap."} | |
| {"_id":"doc-en-react-7f71b422a7c46807c8ad6800cb40555b1545b6633c633ac24a28676df53b6fa9","title":"","text":"<!-- 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. Behavior regression. What is the current behavior? Package throws when being required in Node. 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? should not throw in \"pure\" node (without providing fake document on global). Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? happens on 16.8.0 previous versions work.\nWe also got this issue after upgrading to 16.8.0\nFound the fix and putting together a PR now edit: now on the case"} | |
| {"_id":"doc-en-react-3c4f9d785f1f0c21776dcf45a4d8b42a00aa90af6d304d44f542c6fa5266b716","title":"","text":"Here's an example at jsbin: Clicking for the first time works (mounts a SVG +), but when clicking the same button again (which should unmount the rect+title), react throws an exception. I have no clue how to get around this. Help is very much appreciated. Thanks in advance!\nAh, this is because React doesn't let you unmount the HTML element. I don't believe there's a workaround right now, sorry. cc\nFixed by ."} | |
| {"_id":"doc-en-react-ab535627950c5c4f6788fdc21c9855588e086629d351666b24466bad463969c7","title":"","text":"Nor sure what that means other than that the tests are flakey :'(\nhttps://travis-\nhttps://travis-"} | |
| {"_id":"doc-en-react-420230a6465b37906f76850a9ad9d8a7e4830d1f7a738b4b1e69fb61d7b63fd7","title":"","text":"I am using a few react components made by various libraries like material ui and i get this message on doing i can see only one version of react installed. I am using gulp and browserify for my build process. Any idea how i can solve this?\nI've found this is common when modules have React as a dependency rather than a peerDependency in the npm package. If you're using webpack, I've got around this by creating an alias, perhaps you can do something similar in Gulp.\nAwesome that helped.. Just sharing some ref for others Thanks.\nAlso please file issues in such libraries and gently ask them to use for instead .\nFor those who do not want to install any other packages for resolving. Configure a require key in the browserify object and that will take care of the error"} | |
| {"_id":"doc-en-react-e3a52dd5c509e0b69abfb1882d7c573a3a80737013a0b6115656ad61a05c4ff5","title":"","text":"Check that they were a part of the latest internal sync. For stable releases, prefer that they’ve been landed for a week or so. Only skip this step if you really know what you’re doing! [x] You’re in [x] You’re in [x] You’re in [x] You’re in If not, ping someone on the team![x] Ensure you’re on [x] Do a . [x] Check that your local output matches the commit list. [x] Run in the repo root.[x] For : [x] Look at the version range of in root . [x] Ensure all depending on specify the same range. [x] Run in the repo root. (Don’t miss the caret!) [x] For : [x] Look at the version range of in root . [x] Ensure all depending on specify the same range. [x] Run in the repo root. (Don’t miss the caret!) [x] For : [x] Look at the version range of in root . [x] Ensure all depending on specify the same range. [x] Run in the repo root. (Don’t miss the caret!) [x] This might change the lockfile. This should not change any . [x] Commit the changes, if any. (see )[x] Edit: is broken in the 16 branch but this shouldn't block RC, and will be fixed asap by and in [x] Run in the repo root. [x] Run in the repo root. [x] Run in the repo root.[x] Run in the repo root. [x] If changes, [x] Maybe: If we still have a separate branch for docs when you’re reading this, we need to cherry-pick that commit to that branch. This makes sure the website decoder knows about the updated error codes. But ideally we should just change docs to serve from master. (See and ) [x] Update export in [x] Update in all : [x] [x] [x] [x] [x] If you see any other packages, update this list :-) [x] Run to verify your changes. [x][x] Run in the repo root.[x] Open in the browser for a smoke test."} | |
| {"_id":"doc-en-react-29ef57184113a6fc6d83b3b0327ea1e1ef0ba8b29aaee91d2e5434d12686c6b0","title":"","text":"[x] It should say “Hello world!”[x] Go to and run [x] [x] Go to the repo root and run [x] Open http://localhost:5000/fixtures/packaging/ and verify every iframe shows “Hello World!”[x] Run [x] Run [x] Go to [x] For every subfolder: [x] For non-stable versions: Run in the subfolder. [x] For stable versions: Run in the subfolder.[ ] [ ] [ ]\nw00t~"} | |
| {"_id":"doc-en-react-64f27efe9c05b5e90637eacbe11d9aa29892489350fa2c0c136e339a2cc54a88","title":"","text":"We currently support this, but it makes code less understandable and we'd like to stop supporting it and encourage people to use either e.preventDefault() or e.stopPropagation() as appropriate.\n:+1: And then free up the event handler's return value for something else.\nyou mean? :)\nMaybe =) Otherwise we can always use it to indicate something in a potential future event system."} | |
| {"_id":"doc-en-react-083e8ad88e164af524f1d788f1c1f74caee8c62754c5c2a218713aa219c30266","title":"","text":"I’ve tried to update from react 0.12.2 to 0.13.0 which caused several unit tests of my project to fail. I use react to render html on the server side, this includes the basic html structure like , and elements. All unit tests dealing with such elements are failing with react 0.13.0 but they worked fine with 0.12.2. Here is a minimal example : Running this with react 0.12.2, correctly logs the text content of the title:Running this with react 0.13.0 throws a TypeError\nI think this is just a bug, not an intentional breaking change. Thanks for reporting."} | |
| {"_id":"doc-en-react-8544d3f8d9a29fb32eabf9f48363d5d52db07eccaeed98a815ae9f22c135bf31","title":"","text":"This is a followup issue for pmndrs/react-three-fiber From my understanding of , the DevTools parse the version number advertised by the renderer in to select how to parse the internal fiber object. Unfortunately this means that third-party renderers that advertise a version lower than the equivalent React version for the release they are using get misclassified: for instance is using which is equivalent to , and since major version is much lower than it uses the default values for the enum which in turns lead to getting identified as and hook inspection being unavailable. A short term solution for renderers is to advertise a React-compatible version number, but ideally this is an implementation detail of the devtools that users of should not have to be aware of (also this means the version number displayed in the devtools is wrong). I'm not sure I'm familiar enough with the internals of the devtools to open a PR for this, but since the version parsing logic is used to detect features that are internal to anyway I guess a solution would be to have the Reconciler package add its own value for the constant along with the parameters sent to the devtools backend, and have the devtools use this string if its available over the renderer version.\nOnce and land (and get released) newer versions of the reconciler will inject its own version (to be used instead of the renderer version). Unfortunately this won't help you until you upgrade."} | |
| {"_id":"doc-en-react-b73f04f6ef456bbdf4d219ebf9477a9f047106b95ce11985e591af8f740814e5","title":"","text":"Looks like is broken on a fresh checkout. Just doing a and locally results in running jasmine1, but running the same commands on a fresh checkout attempts to run jasmine2 and results in 300+ failing unit tests."} | |
| {"_id":"doc-en-react-992788d04eacfdbd9f7506fb810dc3b3a874dac91bdb786726dd5919742f52ba","title":"","text":"! 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."} | |
| {"_id":"doc-en-react-1070c0c3d40fc1e98963a550d678b7fe72dc8f38a07278ff28f395d0dc52b8dc","title":"","text":"<!-- 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: 16.x <!-- 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: Nothing. It's part of WAI-ARIA 1.3\nI guess the question is what React considers a \"valid\" aria prop: specific version (range) of Aria version with a (WR,CR,PR,REC) spec editors consider the aria prop that ever existed\nYeah, it seems they've support for this fairly recently.\nWe might also ask: “Why is react telling me what is and isn’t a valid aria attribute.” React isn’t the source of truth for that information. It sounds like the job of a linter rather than something react should warn about.\nI think it might be from a compiler.\nIt's from here:\nWe might also ask: “Why is react telling me what is and isn’t a valid aria attribute.” The reason is that they're often misspelled so on the whole it's beneficial to warn for unknown ones. I'll merge the PR.\nFixed by Will appear in 18."} | |
| {"_id":"doc-en-react-98759475c00b98d8dc2646adcf173b66bd82b00106d0b5062c95bd86c16ea2ec","title":"","text":"Not sure if this is intentional, but if I run this: The resulting inner div has its set to . the resulting DOM string is: but if I remove the key the result is: If is used as the key, the result is the latter above.\nThis is intentional. is an intentional value whereas is the lack of a specified value.\nIf that's the case then IMHO we should escape it properly, as it is now and are treated equally by React (this should be trivial by translating it to or whatever. Although personally I'm not sure when it ever makes sense to have as a key, how about a warning too?"} | |
| {"_id":"doc-en-react-c7e982859a8cdc029effae408c11a8f287f7b31f17233bb05e0078cc7b0bb775","title":"","text":"On the first render it works, but then the update silently fails. Expected would be the semicolon being removed, or an error/warning in the development build. Tested on Chrome latest, Firefox latest, with 0.12.1 and master. Minimal: ran into (on IRC).\nMy first instinct is to put a warning in DEV so we don't incur any costs in prod. This would be similar to our other style key warning (\"you used background-color but probably meant backgroundColor\" or whatever it is we say).\nsounds reasonable, I don't think there's any valid reason to have a semicolon there.\nIt's only a warning, but it's worth considering that is valid CSS IIRC.\nso that wouldn't warn :)\nOh right :), but I've seen plenty of invalid , but perhaps that's an exercise for some other time. Anyway, you might want to ignore white-space after the as well.\nI'm working on this issue. I've a warning, but thinking that it may be a good idea to trim any semicolons as well. The warning will serve to let developers know it's invalid syntax, but try and fix the problem while we're at it."} | |
| {"_id":"doc-en-react-7c6b7cd634d570476502d1781f2d7effe2d2185e88d9fbdc3323463b21686057","title":"","text":"React version: \"eslint-plugin-react-hooks\": \"^4.2.0\" Link to code example: (eslint-plugin-react-hooks) did not fire when it is inside of a Promise block. Please find the detailed explanation in example code below. thx\nHow do you use hooks inside promises? Hooks should only be called in the body of components\nthat is right, but I was not aware of it when I code it. And I think should have caught the error. Can you update the code for to make sure the bug won't fall through the crack? To be specific, the hook I was trying to access inside of promise is , which is about injecting the relay environment to handle the GraphQL query/mutation. Because Eslint did not capture this issue, I merged the bug into production until users complained...\nThis is described in the documentation and any tutorials. I'm not the maintainer of react, but it seems to me that the plugin should not check such things.\nI think this issue is actually the anon function, which is reported here: Leaving this open to confirm fixing anon function fixes this.\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!"} | |
| {"_id":"doc-en-react-12a79a0b1d431bab5b74b762d8ca3d6a1aa22f0675030793feae9d27e7c597e7","title":"","text":"React version: 17.0.2 React-refresh version: 0.10.0 This issue is similar to , but ignores default exported unnamed functions instead. As a code comment suggests, this is a known limitation: Would a fix be considered? Given the following files, making changes to doesn't trigger a re-render. module: module: Making changes to does not re-render the element in . The transformed module does not register the for refresh. Making changes to does re-render the element in .\nThis is intentional — even if we fix this case, we need some heuristic for other tools like lint rules. Why are you using this style? Functions should have names so that you get them in stack traces and so on.\nIndeed, but then it becomes confusing: If there's no way around, this can be closed and I'll make a suggestion downstream to use The code comment mentioned above should then also be more explicit, replacing \"currently\" by \"intentionally\".\nHowever, given that an ignored component prevents a refresh (), I haven't figured out yet whether this is an issue with itself or with . AFAIK, a code update of an ignored component should still trigger a refresh.\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!"} | |
| {"_id":"doc-en-react-93a11fe4313739e08856e20853f01263ec596ff838644c102f9395167f3bcb37","title":"","text":"<!-- 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: eslint-plugin-react-hooks to Releases on GitHub there about eslint-plugin-react-hooks to look for a CHANGELOG for eslint-plugin-react-hooks CHANGELOG <!-- 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: Not code related. <!-- 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: --No change logs. Change logs on the Releases page for eslint-plugin-react-hooks or a separate CHANGELOG. Especially for major version changes so developers are aware of breaking changes that need to be fixed/prioritised. Thank you.\nPlease feel free to help out filling that in. Thanks!\nThanks. I tried searching for an existing issue but couldn't find one so I thought I'd mention it. I've gone through the commit history (standard process without release notes) but without existing knowledge of the codebase, it's a bit hard to understand what changes affect the user and how. So I'll leave someone more in-the-know to write it. :bowing_man:"} | |
| {"_id":"doc-en-react-e2c9d21a071cff3da64ba945cce5c2773214a1b432cc845d9456267fd227cfc0","title":"","text":"I've created a repo to help illustrate what I'm running into: Basically, developing in pure jsx and using the React.createFactory() are not interchangeable under testing using jest. This makes writing unit tests a little trickier. According to this link: , non-jsx components must be wrapped in a React.createFactory(). But, when testing these components using Jest, I've found that these are not interchangeable within tests that mock sub-modules. I'm guessing that the differences stem from using .bind() within React.createFactory:\nupdated the aforementioned repo with some possible workarounds. hopefully it saves someone else some time. perhaps the documentation can be expanded with an example.\ncc\nFirst of all, thank you for an excellent bug report. Very well structured and easy to test. The bad news is that the various wrappers and undoing of wrappers is very complex. It was difficult to get 0.12 into a form where it was a perfect upgrade path. I guess this is a special case where something broke down. I ended up spending a lot of time on this so I'm inclined to just leave 0.12 as broken. :/ The good news is that this works in the master branch so this will be fixed in 0.13. Would you mind submitting a formal pull request with these unit tests to our tests to ensure that it doesn't break again? The exception is asserting on props on mockComponent. We probably won't support that. is considered legacy at this point. It shouldn't be as important in 0.13, since auto-mocked components works better out-of-the-box. We'll probably encourage shallow testing for this use case.\ni'll do my best to get the tests into a PR for your test suite. But, fighting some fires at the moment, so I can't promise a drop date. Thanks for looking into it.\nClosing as very outdated."} | |
| {"_id":"doc-en-react-cdf43bc5ea0b86f1f044d355773507075b88090b6da9c49f5e05980ac771e10f","title":"","text":"Do you want to request a feature or report a bug? bug What is the current behavior? does not work, the code is not executed, there are two files loaded from the Facebook servers but they both return a 5xx error 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: ). Go to and then click the link at the bottom to go to and then click on the link to jsfiddle in the text What is the expected behavior? that there is some generated output in the result pane Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React? Chrome (latest stable, Mac OS), Safari (Mac OS)\nThat’s a pretty old blogpost. I’m not sure why the integration broke, but I recommend to look at more modern examples (e.g. is up to date).\nWell, this blogpost is still linked at the bottom here: So this is how I came there. By reading the guide and I thought I would get an uptodate guide with uptodate links ;-)\nFixed now. The new link is It will appear in the blog post the next time we sync our docs. Thanks!\nGreat. Thanks too."} | |
| {"_id":"doc-en-react-1e38296c0b68c1189567645d4bee40dd42c6efa1fd20400a01c82d0a5ffab32c","title":"","text":"At the end, there is a confusing explanation about \"Duplicated data from props\" in the section \"What Shouldn’t 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."} | |
| {"_id":"doc-en-react-9a4c17119b72486acbc256acc12363b8fd4d52fa529b03236f80736e3d383129","title":"","text":"This may be controversial, but after browsing StackOverflow I believe there's way too many people that load jQuery when they really don't need it. Let's not add to that. I don't think we should be loading jQuery in the tutorial just to do an AJAX request. Let's instead have a dummy object that just returns a static list. Which could simply be replaced to implement AJAX loading. Old post (before I thought of just using static data): Let's replace it with standard XMLHttpRequest code and say something like \"Here's some simple code for doing an AJAX request, alternatively you could use your favourite framework like jQuery, MooTools, YUI, ... instead\". Having jQuery loaded in the tutorial may make people think that jQuery is necessary to use React.\nI was thinking about this more and using a static list would probably be better than AJAX (given the tutorial just AJAX loads a static file). Updated the description to reflect this.\nI think that would be fine. I would still put the equivalent jQuery call because that will be the inevitable question.\nAfter reading pretty much everything related to this issue, I think it would be a good idea to add (for now) a little note in the tutorial, just under the code snippet having the jQuery inclusion. I think it's the only place it really needs to be. What do you think ? (So we can finally close this issue)\nAgreed. A beginner tutorial isn't the place to debate jquery vs no jquery. The point is familiarity.\nFor what it's worth, I removed the use of jQuery in the ReactJS.NET version of the tutorial:\n^ The note about jQuery not being mandatory got merged. I think this is good for now for newcomers. The react users probably already realized they don't actually need jQuery. Closing for now! =)\nIt dose not look very good when you are introducing new people to React and the first ting in the tutorial is: \"We need to do some Ajax calls, let's just add jQuery\"."} | |
| {"_id":"doc-en-react-459d94b9ffcb633b04e63503fb6f939599a3860d53fc82065a5b90ffa4d8464d","title":"","text":"H:githubreactgrunt Running \"delete-build-modules\" task Running \"jsx:normal\" (jsx) task Warning: This socket is closed. Use --force to continue. Aborted due to warnings. on windows. any hint?\nThe issue arises in the jsx task at line 42: File: [no files] Warning: This socket is closed. Use --force to continue. Error: This socket is closed. at () at doWrite () at writeOrBuffer () at () at () at (c:reactgrunttasks) at Object.<anonymous(c:reactnodemodulesgruntlibgrunt) at (c:reactnodemodulesgruntlibgrunt) at Object.<anonymous(c:reactnodemodulesgruntlibutil) at Task.runTaskFn (c:reactnode_modulesgruntlibutil) var child = spawn({ cmd: \"bin/jsx-internal\", args: args }, function(error, result, code) { if (error) { (error); done(false); } else { done(); } }); (JSON.stringify(config.getConfig())); So, looks like the spawn child's input stream is not available. Running node bin/jsx-internal\" works however, get a message saying \"Warning: still waiting for STDIN after 1000ms\"\n- can you take a look?\nI was able to work around this by changing the following in grunttasks to Obviously this change is Windows-only but does provide a possible workaround.\nWhat about changing it to\nYes, I can verify that worked on my machine. Sorry, I used some leftover code for executing batch files which requires going through cmd.\nCool, I can put up a PR for that (unless you have the time,\nSure, I can do that. Thanks for the help!"} | |