{"_id":"q-en-react-ab535627950c5c4f6788fdc21c9855588e086629d351666b24466bad463969c7","text":"Nor sure what that means other than that the tests are flakey :'(\nhttps://travis-\nhttps://travis-"} {"_id":"q-en-react-53bf20fc49b7919c57503cee6ac4dd93f525eb831331357f4f8c4664531d7a75","text":"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."} {"_id":"q-en-react-5360ec7ebda3ce89021bda97c98ba633343da1ad01a2cb94b0daeb001278e958","text":"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."} {"_id":"q-en-react-3d826d584ae12d0c851bfe45a8a182c34466d0f4c7bfb597962db7b869770dda","text":"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!"} {"_id":"q-en-react-2e85d1c388630c3452189c0522bfd16aa31ba5acfb33e1603d41a69c902342c4","text":"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’t be able to until Sunday the earliest. Frankly, the error doesn’t happen with for every handler we have, so there might be something we’re 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’s 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’m ok with a breaking change in releases as long as it’s documented à 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!"} {"_id":"q-en-react-1e38296c0b68c1189567645d4bee40dd42c6efa1fd20400a01c82d0a5ffab32c","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":"q-en-react-d933a6e06b1d6c49d61d5e7b815e1e0cc110275a21e1ed9185bb07dc14989eab","text":"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."} {"_id":"q-en-react-5b07e7e228a24761e0570be670d9936d76e2b49a3d985ee42dfc361ae0dea954","text":"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"} {"_id":"q-en-react-992788d04eacfdbd9f7506fb810dc3b3a874dac91bdb786726dd5919742f52ba","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":"q-en-react-7cee673c705e9cb697230b43b33291930010f626755df2cfe00d278bf0bb75f4","text":"Idea (that I'm pretty sure I saw elsewhere, react-native maybe?)… 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…\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."} {"_id":"q-en-react-54060f4545d63feb8aaa8bc412f08b9ea7936de5654c8d3915d95c8d7cf6e21a","text":"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"} {"_id":"q-en-react-2918d4cceab6c3c8e094d830449f23084d5937cfc7c9c1597de5544182b7ff3e","text":"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"} {"_id":"q-en-react-59b37ca196152e1056c9078333143322d0e34f9ba58219e7e80121a48e0b7386","text":"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 – just adding onKeyUp below onKeyDown here:"} {"_id":"q-en-react-0ed3c797ce6a8a28eb6a574bdcbec21d43c86de7cc53967b9c101ce45e8f2e8e","text":"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: