status
stringclasses
1 value
repo_name
stringlengths
9
24
repo_url
stringlengths
28
43
issue_id
int64
1
104k
updated_files
stringlengths
8
1.76k
title
stringlengths
4
369
body
stringlengths
0
254k
issue_url
stringlengths
37
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
timestamp[ns, tz=UTC]
language
stringclasses
5 values
commit_datetime
timestamp[us, tz=UTC]
closed
facebook/react
https://github.com/facebook/react
12,984
["packages/react-dom/src/server/ReactPartialRenderer.js"]
nested contexts don't unwind correctly when server side rendering
**Do you want to request a *feature* or report a *bug*?** bug **What is the current behavior?** When different contexts are nested, as in they have different types, they do not unwind correctly when rendering via `renderToString()`. Here is a snippet that demonstrates the issue: ``` import React from 'react'; import { renderToString } from 'react-dom/server'; const valueA = { letter: 'A' }; const valueB = { letter: 'B' }; const LetterContext = React.createContext(valueA); const NumberContext = React.createContext(undefined); const html = renderToString(( <LetterContext.Provider value={valueA}> <NumberContext.Provider> <LetterContext.Consumer> {letterValue => ( <div> {letterValue.letter} <LetterContext.Provider value={valueB}> <LetterContext.Consumer> {innerValue => <div>{innerValue.letter}</div>} </LetterContext.Consumer> </LetterContext.Provider> </div> )} </LetterContext.Consumer> <LetterContext.Consumer> {value => <div>{value.letter}</div>} </LetterContext.Consumer> </NumberContext.Provider> </LetterContext.Provider> )); console.log(html); ``` This results in: ``` value.letter ^ TypeError: Cannot read property 'letter' of undefined at Object.children (/Users/ericsoderberg/Documents/git/grommet2/grommet-icons-site/tools/example.js:25:31) at ReactDOMServerRenderer.render (/Users/ericsoderberg/Documents/git/grommet2/grommet-icons-site/node_modules/react-dom/cjs/react-dom-server.node.development.js:2462:55) at ReactDOMServerRenderer.read (/Users/ericsoderberg/Documents/git/grommet2/grommet-icons-site/node_modules/react-dom/cjs/react-dom-server.node.development.js:2325:19) at renderToString (/Users/ericsoderberg/Documents/git/grommet2/grommet-icons-site/node_modules/react-dom/cjs/react-dom-server.node.development.js:2697:25) at Object.<anonymous> (/Users/ericsoderberg/Documents/git/grommet2/grommet-icons-site/tools/example.js:9:14) at Module._compile (internal/modules/cjs/loader.js:678:30) at loader (/Users/ericsoderberg/Documents/git/grommet2/grommet-icons-site/node_modules/babel-register/lib/node.js:144:5) at Object.require.extensions.(anonymous function) [as .js] (/Users/ericsoderberg/Documents/git/grommet2/grommet-icons-site/node_modules/babel-register/lib/node.js:154:7) at Module.load (internal/modules/cjs/loader.js:589:32) at tryModuleLoad (internal/modules/cjs/loader.js:528:12) ``` **What is the expected behavior?** When context providers are nested, they should correctly unwind such that the contexts return the correct value at each level. No exception should be generated and the output should be: `<div>A<div>B</div></div><div>A</div>` **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** This was uncovered using version 16.4.0 of `react-dom` on OSX using node v10.1.0. This only shows up when using `renderToString()`. It works as expected in the browser. ** Note ** I wonder if this might be due to the following snippet of `react-dom-server.node.development.js`. Where the previous provider added to the stack is assumed to have the same type as the provider being popped. ``` var context = provider.type._context; if (this.providerIndex < 0) { context._currentValue = context._defaultValue; } else { // We assume this type is correct because of the index check above. var previousProvider = this.providerStack[this.providerIndex]; context._currentValue = previousProvider.props.value; } ``` I am investigating further and hope to provide a pull request soon.
https://github.com/facebook/react/issues/12984
https://github.com/facebook/react/pull/13019
30bc8ef79295c71f5a4fc459c5bbd4b271f6f390
ec60457bcd22d06c404a44839c14beda88081ac7
2018-06-05T21:00:28Z
javascript
2018-06-11T19:52:39Z
closed
facebook/react
https://github.com/facebook/react
12,964
["packages/react-dom/src/__tests__/ReactDOMFiber-test.js", "packages/react-reconciler/src/ReactChildFiber.js"]
Returning an empty fragment throws a confusing error
https://codesandbox.io/s/40j50607y0 Rendering a component like: ```js const Foo = () => <React.Fragment /> ``` Throws the error: > Foo(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null. The error is confusing because clearly `Foo` _is_ returning a value. I don't know if we want to support rendering empty fragments, but in any case this error is confusing. If this isn't allowed it should explicitly call out that a component cannot return a fragment with no children. cc @gaearon
https://github.com/facebook/react/issues/12964
https://github.com/facebook/react/pull/12966
4ac6f133aff78e7616c7427167f0d43a18441b94
d480782c4162431d06c077ebf8fdf6b8ba7896ef
2018-06-01T21:11:00Z
javascript
2018-06-11T13:43:30Z
closed
facebook/react
https://github.com/facebook/react
12,930
["packages/react-scheduler/src/ReactScheduler.js", "packages/shared/requestAnimationFrameForReact.js"]
Broken `fiber-triangle-demo` and `schedule` fixtures
**Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** These two fixtures are both broken due to a reference to `global` in the bundle they reference. This was introduced in a PR I just landed, so I'm fixing it. See https://github.com/facebook/react/pull/12900 **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 (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:** Open either fixture in Firefox, note the error in the console and the page doesn't update. **What is the expected behavior?** They should have React and/or the schedule module running JS on the page. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** Just on master.
https://github.com/facebook/react/issues/12930
https://github.com/facebook/react/pull/12931
ff724d3c286a1753723ea71e8c046498ed1aac98
79a740c6e32ca300d4e7ff55ab06de172d4237fd
2018-05-29T23:01:14Z
javascript
2018-05-30T00:54:38Z
closed
facebook/react
https://github.com/facebook/react
12,926
["packages/react-dom/src/__tests__/ReactDOMServerIntegrationForms-test.js", "packages/react-dom/src/client/ReactDOMFiberComponent.js", "packages/react-dom/src/client/ReactDOMFiberInput.js"]
`onChange` event doesn't trigger when direclty clicking on the maximum `input[type=range]` value
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** *bug* **What is the current behavior?** When you directly after the loading choose the maximum value on the input type range, the event isn't fire with an onChange. The event is fire when it's not the maximum value of the input. Sandbox: https://codesandbox.io/s/7kv59yj360 Click on the maximum (right) of the input of type range. There is no message on the console and the displayed value doesn't change as expected Click on a other value on the input, a message is displayed in the console and the value change When you click on the last value it's now displayed. **What is the expected behavior?** An event should trigger when you directly click on the maximum value of the input of type range. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** Testing on macOS High Sierra, Firefox 60.0.1, Safari 11.1, Chrome 66.0.3359.181, react 16.2.0 To get around this behaviour, I had to change onChange by onInput but add a blanck onChange to still get the drag behaviour on Safari on Iphone (see this [CodeSandBox ](https://codesandbox.io/s/w0x0jzjvw5))
https://github.com/facebook/react/issues/12926
https://github.com/facebook/react/pull/12939
65ab53694f6edf4437034d5644a602dea162e249
36546b5137e9012ebdc62fc9ec11e3518c9e0aab
2018-05-29T16:00:41Z
javascript
2018-05-31T21:23:26Z
closed
facebook/react
https://github.com/facebook/react
12,872
["packages/react-dom/src/__tests__/ReactDOMInput-test.js", "packages/react-dom/src/client/ReactDOMFiberInput.js"]
Submit/Reset inputs lose text when value=undefined.
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** Bug. **What is the current behavior?** Creating an `<input type='submit'` with `value={undefined}` results in a button with no text. https://codesandbox.io/s/nn7p94y3rl The same behaviour can be seen with `type='reset'` I have a PR open with a proposed fix. https://github.com/facebook/react/pull/12780 **What is the expected behavior?** The input should use the browser's default value for the input (Submit for en, etc.). **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React 16.3.2. Chrome 66.0.3359.139. macOS 10.13.4. Works in React 15 (unsure of earlier versions)
https://github.com/facebook/react/issues/12872
https://github.com/facebook/react/pull/12780
8862172fa3d9f30ea6a7c1072bdae068e9794856
9832a1b6d5df06c3d2a54febe2ab3de43ace02fc
2018-05-21T01:28:08Z
javascript
2018-08-16T14:19:03Z
closed
facebook/react
https://github.com/facebook/react
12,870
["packages/react-reconciler/README.md"]
Broken link for react-reconciler/README.md Practical Examples for React Native
On [README.md](https://github.com/facebook/react/blob/master/packages/react-reconciler/README.md), the link for React Native Practical Example is broken.
https://github.com/facebook/react/issues/12870
https://github.com/facebook/react/pull/12871
9bed4a6aee557e2f7425705c64e49369125cceeb
d7b9b4921b9f5bd12500df9b9f164caa4bcd75eb
2018-05-20T01:02:09Z
javascript
2018-05-20T11:01:00Z
closed
facebook/react
https://github.com/facebook/react
12,765
["packages/react-dom/src/__tests__/ReactDOMInput-test.js", "packages/react-dom/src/client/ReactDOMFiberInput.js"]
defaultChecked prop sets only checked attribute
#### Type `inconsistency` for common use cases. `bug` for projects relying on correct DOM emissions. #### Description It's unclear to me if the following is a known issue or not. Take in consideration the snippet below: ```jsx <input type="checkbox" defaultChecked={true} /> ``` #### Current Behavior Setting the `defaultValue` prop on inputs of other types sets both the `value` and `defaultValue` attribute on the DOM element. When setting the `defaultChecked` prop on inputs of type `checkbox` only the `checked` attribute is correctly set, leaving the `defaultChecked` attribute unchanged. #### Expected Behaviour Like mentioned above, the expected behavior would be for the `defaultChecked` prop to set both the `checked` and `defaultChecked` attributes on the corresponding DOM node (like it's the case with the `defaultValue` prop).
https://github.com/facebook/react/issues/12765
https://github.com/facebook/react/pull/13114
07fefe33310849df81836c1c2e773b7d50c3ec2b
85fe4ddce7ae4d8c93a8107db9e7e65a0631baeb
2018-05-08T14:15:22Z
javascript
2018-07-04T20:00:42Z
closed
facebook/react
https://github.com/facebook/react
12,694
["packages/react-dom/src/__tests__/DOMPropertyOperations-test.js", "packages/react-dom/src/shared/DOMProperty.js"]
Size prop is not attached to the DOM
**Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** The size prop can only be a number and I think this should be true for inputs and selects but not necessarily true for the rest of HTML tags or web components. **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 (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:** Sorry, it's a CodePen. This example uses a framework called OnsenUI that internally uses web components. In the OnsenUI framework there is an icon web component that transforms every size prop value into a string which is not attached to the DOM. I know that the example has more dependencies than React, BUT there is also a simple div (as simple as this `<div size="40px" />`) which is also affected by this issue. https://codepen.io/airamrguez/pen/bMEgEP **What is the expected behavior?** The size prop should be added to the DOM when it is not a number on HTML tags that aren't inputs and selects. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** The affected versions are >= 16.3 It works ok in versions <= 16.2 Browsers: All
https://github.com/facebook/react/issues/12694
https://github.com/facebook/react/pull/12702
045d4f166db6023550b76da6a83fe595a6cdf2f2
dcc854bcc3c940ca583565ce25200ca618c05bf0
2018-04-26T06:50:06Z
javascript
2018-04-28T19:52:30Z
closed
facebook/react
https://github.com/facebook/react
12,688
["packages/react-reconciler/src/ReactFiberBeginWork.js", "packages/react/src/__tests__/forwardRef-test.internal.js"]
Unexpected behavior when use React.forwardRef with React.createContext
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** bug **What is the current behavior?** example: https://codesandbox.io/s/04393o3k6w If the `LogProps` is child of `M.Provider`, and `M.Consumer` is used in its children. When the `M.Provider` is updating, even if the `LogProps` is wrapped in a component that never updates, it can still be triggered by the callback of `React.forwardRef`, and updates the `LogProps`. **What is the expected behavior?** the `LogProps` shouldn't update when the root component had updated, whether or not `M.Consumer` is used in its children; **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** it's used [email protected]
https://github.com/facebook/react/issues/12688
https://github.com/facebook/react/pull/12690
ec57d2994156ba5fcf794100968764bf25206629
d883d59863483a1fb9f3dd0455022e4c6e1a41d5
2018-04-25T14:16:43Z
javascript
2018-04-26T18:47:34Z
closed
facebook/react
https://github.com/facebook/react
12,686
["packages/react-reconciler/src/ReactFiberBeginWork.js", "packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js"]
Strange beahvior React + new Context API
I think it is a bug. Git with example - https://github.com/axules/react-context-research > npm i npm start go to http://localhost:3003 **Dependencies** React v16.3.2 Chrome v65.0.3325.181 ### Components Context - OrderDetailsContext Root component - OrdersView Simple component - OrdersViewRow Subscribed component - OrderDetailsView ### Problem Application have one dynamic context (OrderDetailsContext) and 3 components: one root component (OrdersView) and 2 children components (OrdersViewRow and OrderDetailsView). Only one component (OrderDetailsView) subscribed to dynamic context and have to be refreshed once context data is changed. But with them we have problem. When context is changed the subscribed component is not refreshed and have old version of context data. #### actual OrderDetailsView do not update once context is updated. #### expected OrderDetailsView will update once context is updated. ### First solution Go to OrdersView and move OrderDetailsView to the top of render function, then subscribed component will be updated when context is changed. ![image](https://user-images.githubusercontent.com/20991327/39345798-42d1dd14-49f3-11e8-8d45-ac29bd50204f.png) ### Second strange solution Go to separeted component (OrdersViewRow) and just remove `<td>Remove this td and I will work!</td>`, then subscribed component will be updated when context is changed. ### Video https://youtu.be/WET0a2hApwM ### Reproduce 1. Clone https://github.com/axules/react-context-research.git 1. npm i 1. npm start 1. Open http://localhost:3003 in Chrome 1. Open dev tools in Chrome 1. Click on View button #### expected * 'Loading...' text should be visibled and hidden after. * Text should be updated and new number should be displayed. * console log should be ![image](https://user-images.githubusercontent.com/20991327/39346895-073bc6c4-49f9-11e8-85c9-1f085208bcb3.png) #### actual * 'Loading...' text is not visibled. * Text is not changed. * console log is ![image](https://user-images.githubusercontent.com/20991327/39346859-e5877f46-49f8-11e8-95a6-38b0fe492e5e.png)
https://github.com/facebook/react/issues/12686
https://github.com/facebook/react/pull/12708
7c3932857195d0cfba2379875b65f1bd1fae39fd
045d4f166db6023550b76da6a83fe595a6cdf2f2
2018-04-25T06:19:03Z
javascript
2018-04-28T00:52:48Z
closed
facebook/react
https://github.com/facebook/react
12,670
["packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js", "packages/react-dom/src/__tests__/ReactDOMServerLifecycles-test.js", "packages/react-dom/src/server/ReactPartialRenderer.js", "packages/react-reconciler/src/ReactFiberClassComponent.js", "packages/react/src/__tests__/ReactCoffeeScriptClass-test.coffee", "packages/react/src/__tests__/ReactES6Class-test.js", "packages/react/src/__tests__/ReactTypeScriptClass-test.ts", "packages/react/src/__tests__/createReactClassIntegration-test.js"]
Improve warning message for failure to initialize `state` when using `getDerivedStateFromProps`
**Do you want to request a *feature* or report a *bug*?** bug **What is the current behavior?** The warning for a failure to initialize state when using `getDerivedStateFromProps` is not as clear as it could be. This component produces the warning: > MyComponent: Did not properly initialize state during construction. Expected state to be an object, but it was undefined.` ```js class MyComponent extends React.Component { static getDerivedStateFromProps(nextProps, prevState) { return null; } render() { return <span>Foo</span> } } ``` The warning can be resolved by adding `state = {}` either in the class definition or the constructor, or by not using `getDerivedStateFromProps`. See https://github.com/reactjs/reactjs.org/issues/796 for more detail on why this warning message can be counter-intuitive. Since the [warning is specific](https://github.com/facebook/react/blob/b548b3cd640dbd515f5d67dafc0216bb7ee0d796/packages/react-reconciler/src/ReactFiberClassComponent.js#L509-L510) to the use of `getDerivedStateFromProps` and not triggered by any other state or lifecycle methods, and state initialization isn't required for other state methods like `this.setState`, it would make sense to me to mention `getDerivedStateFromProps` explicitly in the warning. Here's a proposal for a new warning message: > MyComponent: Component state must be initialized when using getDerivedStateFromProps. Expected state to be an object, but it was undefined. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React >= 16.3.0
https://github.com/facebook/react/issues/12670
https://github.com/facebook/react/pull/13317
fa824d092195713bf85d56cbda8bad976bbc1900
b179bae0ae3a9d80bfbe440c8861786b7f928ce1
2018-04-23T15:29:28Z
javascript
2018-08-03T15:09:57Z
closed
facebook/react
https://github.com/facebook/react
12,572
["packages/react-test-renderer/package.json", "scripts/rollup/bundles.js"]
Feature Request: UMD version of react-test-renderer
react and react-dom have both cjs and umd versions available. Is it possible to create a umd version of react-test-renderer as well?
https://github.com/facebook/react/issues/12572
https://github.com/facebook/react/pull/12594
3eae866e03a96c4f46e257cba73ca158b049ab05
b8461524db6d3e016fabf001ad8fa086b4918ef9
2018-04-08T02:37:39Z
javascript
2018-04-10T14:49:19Z
closed
facebook/react
https://github.com/facebook/react
12,551
["packages/react-reconciler/src/ReactFiberBeginWork.js", "packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js"]
New Context Provider may block Old context propagation if children are constant
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** It seems that, if the children of a new-style `React.createContext()` context `Provider` are constant, the `Provider` can block updates from old-style `this.context` context providers from propagating to `this.context` consumers. This sandbox demonstrates the issue. Clicking the button with a number will correctly increment the `Root`'s `state` and `context`, but the update is only propagated to the `Child3`'s `context` (and its button) when the "Colors!" button is clicked, as it causes an update to the `value` of the new-style `Provider`: https://codesandbox.io/s/ol4lpokpjy <details> <summary>Copy of the source code in the sandbox</summary> ```jsx import PropTypes from "prop-types"; import React from "react"; import ReactDOM from "react-dom"; class Root extends React.Component { constructor(props: {}) { super(props); this.state = { count: 0 }; this.countUp = this.countUp.bind(this); } getChildContext() { return { ...this.context, count: this.state.count, countUp: this.countUp }; } render() { return this.props.children; } countUp() { this.setState(({ count }) => ({ count: count + 1 })); } } Root.childContextTypes = { count: PropTypes.number.isRequired, countUp: PropTypes.func.isRequired }; const ctx = React.createContext(); class Child1 extends React.Component { constructor(props: { onClick(): void }) { super(props); this.state = { color: randomHexColor(), newColor: this.newColor.bind(this) }; } render() { return ( <ctx.Provider value={this.state}>{this.props.children}</ctx.Provider> ); } newColor() { const color = randomHexColor(); this.setState(() => ({ color })); } } function randomHexColor() { const colorStr = Math.floor(Math.random() * (Math.pow(2, 24) - 1)).toString( 16 ); return "#000000".slice(0, -colorStr.length) + colorStr; } class Child2 extends React.Component { render() { return ( <ctx.Consumer> {ctx => ( <React.Fragment> <Child3 color={ctx.color} /> <button onClick={ctx.newColor}>Colors!</button> </React.Fragment> )} </ctx.Consumer> ); } } class Child3 extends React.Component { render() { return ( <button style={{ color: this.props.color }} onClick={this.context.countUp} > {this.context.count} </button> ); } } Child3.contextTypes = { count: PropTypes.number.isRequired, countUp: PropTypes.func.isRequired }; ReactDOM.render( <Root> <Child1> <Child2 /> </Child1> </Root>, document.getElementById("root") ); ``` </details> **What is the expected behavior?** Both old-style and new-style context updates should coexist. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** 16.3.1; also broken in 16.3.0. --- This seems to only happen if the `children` of the `Provider` are constant, which is what happens when the children are provided on the first and only `ReactDOM.render` call. If `Child1` is updated to directly use `<Child2/>` instead of `{this.props.children}`, the problem does not happen. This can also be a problem when using a production optimization that hoists constant elements outside the Component if the specified children are constant, which would even defeat the fix/workaround for the example above.
https://github.com/facebook/react/issues/12551
https://github.com/facebook/react/pull/12586
d883d59863483a1fb9f3dd0455022e4c6e1a41d5
7c3932857195d0cfba2379875b65f1bd1fae39fd
2018-04-05T09:18:08Z
javascript
2018-04-26T19:59:17Z
closed
facebook/react
https://github.com/facebook/react
12,540
["packages/react-reconciler/src/ReactStrictModeWarnings.js"]
react-dom development bundle uses Array.from
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** Bug (?) **What is the current behavior?** Currently, the 16.3.x versions of `react-dom` ship [`react-dom.development.js`](https://unpkg.com/[email protected]/cjs/react-dom.development.js) containing usage of `Array.from` which is not available in certain React-supported browsers like IE11. It causes breakage if those particular code paths are taken in such a browser (I ran into it using `<StrictMode>` in IE11). **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 (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:** Reproduction (should see "Hello, world!" but IE11 will crash and show nothing): https://codepen.io/anon/pen/zWJBrO?editors=0010 **What is the expected behavior?** `react-dom.development.js` would not use `Array.from` or document that a polyfill is required. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** `react` and `react-dom`: 16.3.0-alpha.0 through 16.3.1 Internet Explorer 11
https://github.com/facebook/react/issues/12540
https://github.com/facebook/react/pull/12546
d328e362e86a6af4a0664e004b8f97f18ce972c8
8ec0e4a99df76c0ff1779cac4f2eaaaf35a6b5bb
2018-04-04T17:01:55Z
javascript
2018-04-04T20:54:27Z
closed
facebook/react
https://github.com/facebook/react
12,506
["packages/react-dom/src/events/getEventTarget.js"]
Possible incorrect event.target on number inputs in IE9?
Since React 16.0.0, it looks like there might be a case where `event.target` on a change event in IE9 reports as the window, but I can't reproduce it outside of the DOM test fixtures. *Steps to reproduce* 1. Open this build of the fixtures: http://react-ie-9-target-issues.surge.sh in IE9 2. Enter text into an input 3. Observe that the `event.target.value` is the window, as recorded by the fixture I can not reproduce this using the following CodePen: https://codepen.io/nhunzaker/pen/dmeoxJ?editors=1010 Viewable in IE9 here: https://s.codepen.io/nhunzaker/debug/dmeoxJ/PNrvYLevqQbM Here's a diff of my changes with master: https://github.com/facebook/react/compare/master...nhunzaker:ie9-target-issue Any idea what's going on? Here's what I think I need to check next: - [x] Differences in rAF polyfill - [x] Differences in map/set polyfill _This list will probably grow_
https://github.com/facebook/react/issues/12506
https://github.com/facebook/react/pull/12976
23be4102df273d6ee6d9be42c6d65885d0a914b1
4ac6f133aff78e7616c7427167f0d43a18441b94
2018-03-31T14:45:51Z
javascript
2018-06-11T13:35:42Z
closed
facebook/react
https://github.com/facebook/react
12,502
["packages/react-reconciler/src/ReactFiber.js", "packages/react-reconciler/src/ReactFiberScheduler.js", "packages/react-reconciler/src/__tests__/ReactIncrementalErrorReplay-test.internal.js"]
Possible regression in dev mode in v16.3
[This example](https://codesandbox.io/s/1zn2o513pq) presents a huge performance drop between React 16.2 and React 16.3. In investigated it and noticed several things: - Perfomance drop is only visible using development bundle - This is not related to styled-components (a simple div presents the same problem) - I tried to investigate in performance tab of Chrome dev tools and I noticed that I get React measures even without "?react_perf" - React Tree Reconciliation seems very long, do not know why It is not a big problem for me, but it looks weird, so I decided to [share it on Twitter](https://twitter.com/neoziro/status/979756579296817154), then @gaearon [invited me to submit an issue about it](https://twitter.com/dan_abramov/status/980036013518139398).
https://github.com/facebook/react/issues/12502
https://github.com/facebook/react/pull/12510
0c80977061ba576cee9ae0891245be233929d2ed
59dac9d7a6a2f0b66003cf717d71b5587265423f
2018-03-31T11:22:27Z
javascript
2018-04-01T18:10:37Z
closed
facebook/react
https://github.com/facebook/react
12,500
["packages/react/src/ReactElementValidator.js"]
Warning in IE 11 when using React.Fragment
**Do you want to request a *feature* or report a *bug*?** bug **What is the current behavior?** With React 16.3.0, when using `<React.Fragment>` IE 11 gives the following warning: ``` Warning: Invalid prop `children` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props. ``` Steps to reproduce: 1. Use `create-react-app` to create a new React app. 2. Add `<React.Fragment>` to `App.js`. For example: ``` import React, { Component } from "react"; import logo from "./logo.svg"; import "./App.css"; class App extends Component { render() { return ( <div className="App"> <React.Fragment> <header className="App-header"> <img src={logo} className="App-logo" alt="logo" /> <h1 className="App-title">Welcome to React</h1> </header> <p className="App-intro"> To get started, edit <code>src/App.js</code> and save to reload. </p> </React.Fragment> </div> ); } } export default App; ``` 3. Open the app in IE 11. 4. Open IE dev tools and refresh the browser. 5. You should see the above mentioned warning message in the console window. No warnings with Chrome, Firefox, and Edge. **What is the expected behavior?** There should be no warnings shown. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React: 16.3.0 Browser: IE 11 OS: Windows 10
https://github.com/facebook/react/issues/12500
https://github.com/facebook/react/pull/12504
fa8e67893fca1b3902637129972032bca248a584
0c80977061ba576cee9ae0891245be233929d2ed
2018-03-31T11:00:44Z
javascript
2018-04-01T00:14:36Z
closed
facebook/react
https://github.com/facebook/react
12,481
["fixtures/attribute-behavior/AttributeTableSnapshot.md", "packages/react-dom/src/shared/DOMProperty.js"]
[SVG] Enable focusable to accept boolean values
Moved discussion from https://github.com/facebook/react/issues/6212. ## Situation The [`focusable` attribute](https://www.w3.org/TR/SVGTiny12/interact.html#focusable-attr) from the SVG specifications is an [enumerated attribute](https://html.spec.whatwg.org/#keywords-and-enumerated-attributes) accepting values `"true"`, `"false"` and `"auto"`. Because it is technically not a boolean attribute (although it certainly somehow looks like it), React expects the value to be passed as a string. See the following example: ```diff -<svg focusable>I should be focusable</svg> -<svg focusable={true}>I should be focusable</svg> +<svg focusable='true'>I should be focusable</svg> ``` The thing is, the `focusable` attribute is often used in conjunction with elements from the ARIA specification, in which attributes are booleans and not enumerated attributes with `"true"` and `"false"` values. The [`aria-hidden` attribute](https://www.w3.org/TR/wai-aria-1.1/#aria-hidden) is a good example of that. For instance, [following a good practice for icon-buttons](https://fvsch.com/code/svg-icons/#section-html): ```html <button type="button"> <svg aria-hidden="true" focusable="false"> <use xlink:href="#icon-play"></use> </svg> <span class="access-label">Start playback</span> </button> ``` From an authoring perspective, the above snippet would likely be written like this in JSX: ```jsx <button type='button'> <Icon icon='play' aria-hidden={true} focusable={false} /> <span class='access-label'>Start playback</span> </button> ``` The problem is that `focusable` **cannot** be authored as a boolean, otherwise it will **not** be printed out in the DOM. On the other hand, `aria-hidden` is perfectly fine being written as a boolean at it gets coerced by React. ## Proposal Given the default value for the `focusable` attribute is `"auto"`, this is very likely this attribute gets authored to change its value to `true` or `false`. In that regard, it is confusing that it has to be specified as a string, when other attributes accepting booleans can be authored as such. The suggestion would be to make it possible for `focusable` to be specified as either a boolean or a string, like other similar attributes. In other words, all the following should work: ```jsx <svg focusable>I should be focusable</svg> <svg focusable={true}>I should be focusable</svg> <svg focusable='true'>I should be focusable</svg> <svg focusable={false}>I should not be focusable</svg> <svg focusable='false'>I should not be focusable</svg> <svg focusable='auto'>I should be focusable</svg> ``` From an authoring perspective, I believe this would be the most straightforward and less confusing.
https://github.com/facebook/react/issues/12481
https://github.com/facebook/react/pull/13339
a66217b5716a5a32e6fb80bd1774610b05c4be12
3cfab14b96a55d53ba5784a9915b8c1660da08be
2018-03-29T08:35:33Z
javascript
2018-08-07T18:39:56Z
closed
facebook/react
https://github.com/facebook/react
12,474
["packages/react-dom/src/__tests__/ReactDOMRoot-test.internal.js", "packages/react-reconciler/src/ReactFiberScheduler.js"]
Uncaught Error: Should be working on a root. This error is likely caused by a bug in React.
Got this debugging another error. Filing here for reference. Original code: https://phabricator.intern.facebook.com/P59317705
https://github.com/facebook/react/issues/12474
https://github.com/facebook/react/pull/12480
268a3f60dfe67c4f6439fc37b569a2d81c81a53a
c44665e83278becfe7a3afdf788789536d63387b
2018-03-28T15:03:46Z
javascript
2018-03-29T01:18:09Z
closed
facebook/react
https://github.com/facebook/react
12,432
["packages/react-test-renderer/src/ReactShallowRenderer.js", "packages/react-test-renderer/src/__tests__/ReactShallowRenderer-test.internal.js", "packages/react-test-renderer/src/__tests__/ReactShallowRenderer-test.js"]
Remove DEV-only warnings from shallow renderer
For consideration. These warnings are already covered by renderers based on react-reconciler. Maybe we don't gain that much by mirroring them in the shallow renderer? Maybe it's not worth the added complexity? Particularly with more complicated warnings like the ones being added for #12419 and #12404.
https://github.com/facebook/react/issues/12432
https://github.com/facebook/react/pull/12433
c1308adb4bbe9e5513bbc4499e0696d97e9c897f
8c20615b06d22e023ff54a30e2602f0409876441
2018-03-22T18:08:16Z
javascript
2018-03-22T18:32:37Z
closed
facebook/react
https://github.com/facebook/react
12,428
[".eslintrc.js", "packages/react-dom/src/__tests__/ReactCompositeComponent-test.js", "packages/react-dom/src/__tests__/ReactDOMTextarea-test.js", "packages/react-dom/src/__tests__/ReactServerRendering-test.js", "scripts/eslint-rules/__tests__/no-to-warn-dev-within-to-throw-test.internal.js", "scripts/eslint-rules/index.js", "scripts/eslint-rules/no-to-warn-dev-within-to-throw.js", "scripts/jest/matchers/__tests__/toWarnDev-test.js"]
We don't assert on warnings for tests that throw
I think this shouldn't pass: ```js expect(() => { expect(() => { throw new Error('haha') // no warning }).toWarnDev( 'nope', ); }).toThrow('haha'); ``` but it does.
https://github.com/facebook/react/issues/12428
https://github.com/facebook/react/pull/12457
026aa9c97813ee8e9886e2c9035a332f93c38720
e106b8c44f9a81058f250c7ee37b61ae0094455e
2018-03-22T16:57:57Z
javascript
2018-08-21T14:43:02Z
closed
facebook/react
https://github.com/facebook/react
12,427
["scripts/jest/matchers/toWarnDev.js"]
jestDiff() call in toWarnDev() returns null, making test failure confusing
<img width="953" alt="screen shot 2018-03-22 at 4 47 40 pm" src="https://user-images.githubusercontent.com/810438/37785026-037d0788-2df1-11e8-9cbd-5b9e2b2d10db.png"> Caused by this line: https://github.com/facebook/react/blob/40fa6160534e2bc67b0c43f0b32dcdd1d214068b/scripts/jest/matchers/toWarnDev.js#L52 Calling `jestDiff` with two different strings returns `null`.
https://github.com/facebook/react/issues/12427
https://github.com/facebook/react/pull/12456
dadafd6bd802082b990e447032cb82574bcdc118
e9ba8ec8663071ebe9467c13576b3c18ad4e1b58
2018-03-22T16:50:03Z
javascript
2018-03-26T17:48:36Z
closed
facebook/react
https://github.com/facebook/react
12,411
["packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js", "packages/react-reconciler/src/ReactFiberClassComponent.js", "packages/react-test-renderer/src/ReactShallowRenderer.js", "packages/react-test-renderer/src/__tests__/ReactShallowRenderer-test.js", "packages/react/src/__tests__/createReactClassIntegration-test.js"]
UNSAFE_* Lifecycle hooks don't run if getDerivedStateFromProps is present
https://codesandbox.io/s/xl7k7j1k6w Not sure if this is intended or not, the longer term existence of these hooks suggested to me that they have their purposes still, so might be needed in conjunction with gDSFP. The particular use-case that caused me to discover this was a migrating: https://github.com/react-bootstrap/react-bootstrap/blob/master/src/Dropdown.js#L137 where document focus needs to be checked _prior_ to an update flushing because the update changes visual state and drops focus. I could move this to `render()` but React has traditionally yelled at me when doing ref stuff there. Admittedly in the migrated code i don't need `findDOMNode` so it'd be fine.
https://github.com/facebook/react/issues/12411
https://github.com/facebook/react/pull/12419
0af384b4c33bf7d039f513e0869665824e08bb6b
c1308adb4bbe9e5513bbc4499e0696d97e9c897f
2018-03-20T20:14:42Z
javascript
2018-03-22T18:16:54Z
closed
facebook/react
https://github.com/facebook/react
12,389
["packages/react-reconciler/src/ReactFiberBeginWork.js", "packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js"]
propagateContextChange Stuck in an Infinite Loop
**Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** In the process of converting [my Navigation router](https://grahammendick.github.io/navigation/) to the new context API I found that `propagateContextChange` sometimes gets stuck in an infinite loop. I’ve created a [JsFiddle of the problem](https://jsfiddle.net/pxzo0foq/42/). If you click the 'Name' sort Hyperlink **two times** then, on the **second click**, it enters the infinite loop. The JsFiddle is as simple as I could make it. For example, if you get rid of the 'Date of Birth' column then the problem doesn’t happen!? **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 (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:** https://jsfiddle.net/pxzo0foq/42/ **What is the expected behavior?** It should not get stuck in an infinite loop **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React version 16.3.0-alpha.2. This is to do with the new Context API introduced in 16.3
https://github.com/facebook/react/issues/12389
https://github.com/facebook/react/pull/12402
e1ff342bf7f451fb995e0ea2bfb10889deef022f
8d0942242476024ac74d4ca2fcac9824b3124dc8
2018-03-16T11:25:26Z
javascript
2018-03-20T13:06:59Z
closed
facebook/react
https://github.com/facebook/react
12,349
["packages/react-dom/src/shared/DOMProperty.js"]
React adds "className" to DOM instead of "class" in IE11
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** It is a bug **What is the current behavior?** React adds "className" to the DOM instead of "class" property. **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 (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:** Open the link below in IE11 and inspect the DOM. There will be the following h1 - `<h1 className="test-ie11-bug">Hello React :)</h1>` https://vydimitrov.github.io/react-simple-boilerplate/ Link to the test repo: https://github.com/vydimitrov/react-simple-boilerplate **What is the expected behavior?** To add "class" to DOM when an element has property "className" **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React 16.3.0-alpha.1 Internet Explorer 11 - version 11.540.15063.0 It works as expected in React 16.2.0
https://github.com/facebook/react/issues/12349
https://github.com/facebook/react/pull/12353
fcc4f52cdded62e3b8e95d18e3e6adf17b981eed
280acbcb713fe0751c6230b94efb45376eb4af67
2018-03-09T09:16:39Z
javascript
2018-03-12T17:42:17Z
closed
facebook/react
https://github.com/facebook/react
12,285
["scripts/jest/matchers/toWarnDev.js"]
scripts/jest/matchers/toWarnDev: Expected and actual arguments to `jest-diff` are mixed up.
**Do you want to request a *feature* or report a *bug*?** bug **What is the current behavior?** `toWarnDev` calls `jestDiff(a, b)` as `jestDiff(normalizedMessage, expectedMessages[0])` and `jestDiff([normalizedMessage], expectedMessages)`: https://github.com/facebook/react/blob/94518b068bf52196abea0c83f4c9926bfe2065c6/scripts/jest/matchers/toWarnDev.js#L49-L57 [`jestDiff(a, b)`](https://github.com/facebook/jest/blob/457776b2889a9be1ce8a2c636a23417264a98d99/packages/jest-diff/src/index.js#L54) [calls](https://github.com/facebook/jest/blob/457776b2889a9be1ce8a2c636a23417264a98d99/packages/jest-diff/src/index.js#L93) [`diffStrings(a, b)`](https://github.com/facebook/jest/blob/457776b2889a9be1ce8a2c636a23417264a98d99/packages/jest-diff/src/diff_strings.js#L249-L251) where by default `a` is annotated as `'Expected'` (green), `b` as `'Received'` (red). https://github.com/facebook/jest/blob/457776b2889a9be1ce8a2c636a23417264a98d99/packages/jest-diff/src/diff_strings.js#L86-L90 ```js const getAnnotation = (options: ?DiffOptions): string => chalk.green('- ' + ((options && options.aAnnotation) || 'Expected')) + '\n' + chalk.red('+ ' + ((options && options.bAnnotation) || 'Received')) + '\n\n'; ``` **What is the expected behavior?** `toWarnDev` should pass the expected values into `a`, the actual (received) values into `b` of `jestDiff`: ```js jestDiff(expectedMessages[0], normalizedMessage) ``` ```js jestDiff(expectedMessages, [normalizedMessage]) ```
https://github.com/facebook/react/issues/12285
https://github.com/facebook/react/pull/12288
9cf3733a9a43aa53d1a3cc94b2cd015b235b84cc
d3e0a3aaf33dd0134a2c5296db8b6ca43cab968e
2018-02-25T05:29:36Z
javascript
2018-06-08T12:18:22Z
closed
facebook/react
https://github.com/facebook/react
12,251
["fixtures/dom/yarn.lock", "packages/react-dom/src/__tests__/ReactDOM-test.js", "packages/react-dom/src/__tests__/ReactDOMEventListener-test.js", "packages/react-dom/src/client/ReactDOMFiberComponent.js", "packages/react-dom/src/events/ReactBrowserEventEmitter.js"]
Does react still require non-toplevel submit handler?
**Do you want to request a *feature* or report a *bug*?** bug? Maybe. **What is the current behavior?** Using non-delegated handler for submit event. **What is the expected behavior?** After IE9, at least I know, submit event bubbled up. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** 16.2.0
https://github.com/facebook/react/issues/12251
https://github.com/facebook/react/pull/13358
e07a3cd28f3b360755d6832a01d724a3b7576bc4
725e499cfb4da60da46aa5b44c4bad29cad3d08f
2018-02-20T05:09:50Z
javascript
2018-08-10T19:10:35Z
closed
facebook/react
https://github.com/facebook/react
12,182
["packages/react-reconciler/src/ReactFiberNewContext.js", "packages/react-reconciler/src/__tests__/ReactNewContext-test.internal.js"]
unexpected ContextConsumer or ContextProvider behavior
**Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** When use two or more contexts that created by `createContext`,in the child-tree of cxt2.Provider,i use cxt1.Provider to set a new context of cxt1,i expect only the child consumer got the new cxt1,but the result is that the cxt2.Provider's next sibling's child-tree got an unexpected cxt2.Provider's new context **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 (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:** [createContext issue](https://codesandbox.io/s/4j3m6l2l3w) **What is the expected behavior?** ContextProvider only affect the children node. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React 16.3.0-alpha.0
https://github.com/facebook/react/issues/12182
https://github.com/facebook/react/pull/12187
49b0ca1b836751ae78fd191286b9eb3bf2be385b
b5e961508709ac61f7e2de60a047238216f09a04
2018-02-08T06:34:51Z
javascript
2018-02-08T22:23:41Z
closed
facebook/react
https://github.com/facebook/react
12,177
["packages/react-dom/src/__tests__/refs-destruction-test.js", "packages/react-reconciler/src/ReactFiberBeginWork.js"]
Removing a ref callback works differently on HostComponents vs ClassComponents
**Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** If you remove the ref from a mounted HostComponent on an update, it calls the original ref with null. If you remove the ref from a mounted ClassComponent on an update, it does *not* call the original ref with null. https://codesandbox.io/s/q8k7776pz9 Note that it doesn't call ref1 (passed to FooInner as ref) with null https://codesandbox.io/s/849538y8m8 Note that it **does** call ref1 (passed to div as ref) with null If you *modify* the ref from either a HostComponent or a ClassComponent (change from `ref={this.ref1}` to `ref={this.ref2}`), the original ref (ref1) is called with null and the new ref (ref2) is called with the instance. (take the sandboxes above and change the second `<Foo>` to `ref={this.ref2}` **What is the expected behavior?** Honestly not sure but it should be consistent. The reason this is different is because for HostComponents, [we decide to schedule a Ref effect on completeWork](https://github.com/facebook/react/blob/87ae211ccd8d61796cfdef138d1e12fb7a74f85d/packages/react-reconciler/src/ReactFiberCompleteWork.js#L464-L466) as long as `current.ref !== workInProgress.ref`. For ClassComponents, [this decision is made on beginWork ](https://github.com/facebook/react/blob/87ae211ccd8d61796cfdef138d1e12fb7a74f85d/packages/react-reconciler/src/ReactFiberBeginWork.js#L184-L188) as long as `workInProgress.ref && (!current || current.ref !== workInProgress.ref)` -- which means if workInProgress.ref is null, the behavior is different (hence this issue). We should probably pick one and make it consistent. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** Unsure - it for sure is an issue in latest/Fiber, but I haven't dug deep enough to see what happened in <16.
https://github.com/facebook/react/issues/12177
https://github.com/facebook/react/pull/12178
4a20ff26ecfe9bc66941d79f7fce2c67be8ee236
d529d2035e3fe741acdf1f01619326588fcca697
2018-02-07T18:47:09Z
javascript
2018-02-07T20:13:42Z
closed
facebook/react
https://github.com/facebook/react
12,171
["packages/events/SyntheticEvent.js", "packages/react-dom/src/events/__tests__/SyntheticEvent-test.js"]
Remove use of Proxy for events in development
I think maybe we should revert https://github.com/facebook/react/pull/5947. People already think `proxyEvent` is some kind of an API: https://github.com/facebook/react/issues/12169. It's also annoying to view in the debugger because none of the properties show up. Instead, we could seal the event object or something like that.
https://github.com/facebook/react/issues/12171
https://github.com/facebook/react/pull/13225
171e0b7d447a20b7cc90808a95478c6e5b8b6af0
acbb4f93f09ca37f02136f9aa6f7425fde1da2cc
2018-02-07T08:17:56Z
javascript
2018-07-17T23:14:13Z
closed
facebook/react
https://github.com/facebook/react
12,158
["packages/react-reconciler/src/ReactChildFiber.js", "packages/react-reconciler/src/__tests__/ReactIncrementalSideEffects-test.internal.js", "packages/react/src/__tests__/ReactStrictMode-test.internal.js"]
Add string-ref warning to strict mode subtrees
https://github.com/facebook/react/issues/12158
https://github.com/facebook/react/pull/12161
f05296baf586dc8e6d6e6a3e6d666c8dd8e4ccd5
6f2f55ed568063a4efbe4b2f1e11297da877fe73
2018-02-05T20:23:23Z
javascript
2018-02-06T15:43:31Z
closed
facebook/react
https://github.com/facebook/react
12,150
["packages/react-test-renderer/src/ReactTestRenderer.js", "packages/react-test-renderer/src/__tests__/ReactTestRenderer-test.js"]
ContextConsumer and ContextProvider in react-test-renderer
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** bug **What is the current behavior?** > Unsupported component type 13 in test renderer. This is probably a bug in React. `invariant()` is called because `react-test-renderer` does not know about the the `ContextConsumer` and `ContextProvider` component types. **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 (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:** https://codesandbox.io/s/wkvl8ojpjw **What is the expected behavior?** It can identify the new context types. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** 16.3.0-alpha.0
https://github.com/facebook/react/issues/12150
https://github.com/facebook/react/pull/12237
93ce76b7eafa7aaa9ebeb60efcc94c1f3954607c
e68c0164aa92ed383a0060639d9c449e2f740fb5
2018-02-04T18:59:20Z
javascript
2018-02-16T19:27:20Z
closed
facebook/react
https://github.com/facebook/react
12,147
["packages/react-art/package.json", "packages/react-call-return/package.json", "packages/react-dom/package.json", "packages/react-noop-renderer/package.json", "packages/react-reconciler/package.json", "packages/react-test-renderer/package.json", "scripts/release/build-commands/update-noop-renderer-dependencies.js", "scripts/release/build-commands/update-package-versions.js", "scripts/release/build.js"]
CI broken
Looks like commit 8a995f7 broke our CI. Not sure why. The release script passed all 4 test variants (dev+prod and bundle dev+prod). At first I was unable to reproduce the broken behavior, but after doing a fresh install (`rm -rf node_modules && yarn install`) I'm able. I'm not sure yet what is causing this. Perhaps it has something to do with Yarn workspace and prerelease versions?
https://github.com/facebook/react/issues/12147
https://github.com/facebook/react/pull/12148
be85544b89cd88add5e1158812c16f4ca6c39b3a
dc271876a225d6efc7f13c07f82aba6cba2f39c7
2018-02-04T03:14:18Z
javascript
2018-02-04T16:54:42Z
closed
facebook/react
https://github.com/facebook/react
12,145
["scripts/tasks/eslint.js"]
process.CI check looks like a typo
`if (process.CI)` check looks like a typo, here https://github.com/facebook/react/blob/master/scripts/tasks/eslint.js#L13 May be I'm wrong but I haven't found what `process.CI` is. If CI is https://circleci.com/docs/2.0/env-vars/#circleci-environment-variable-descriptions it should be checked as `process.env.CI`
https://github.com/facebook/react/issues/12145
https://github.com/facebook/react/pull/12146
885a291141330eb74e8a98316e286a9ad093f22c
be85544b89cd88add5e1158812c16f4ca6c39b3a
2018-02-03T19:28:28Z
javascript
2018-02-04T01:56:06Z
closed
facebook/react
https://github.com/facebook/react
12,144
["packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.internal.js", "packages/react-dom/src/__tests__/ReactDOMServerLifecycles-test.internal.js", "packages/react-dom/src/server/ReactPartialRenderer.js", "packages/react-reconciler/src/ReactStrictModeWarnings.js", "packages/react-test-renderer/src/ReactShallowRenderer.js", "packages/react-test-renderer/src/__tests__/ReactShallowRenderer-test.internal.js"]
Change lifecycle deprecation warnings to low-pri
Any warnings driven off of `warnAboutDeprecatedLifecycles` should use `shared/lowPriorityWarning` rather than `fbjs/lib/warning` to avoid thrashing automated tests.
https://github.com/facebook/react/issues/12144
https://github.com/facebook/react/pull/12159
86914cb30a7654d13a17d34a3b3a5af97c2d2855
f05296baf586dc8e6d6e6a3e6d666c8dd8e4ccd5
2018-02-03T17:17:38Z
javascript
2018-02-05T21:39:07Z
closed
facebook/react
https://github.com/facebook/react
12,106
["packages/react-test-renderer/src/ReactTestRenderer.js", "packages/react-test-renderer/src/__tests__/ReactTestRenderer-test.js"]
react-test-renderer: toTree() does not yet know how to handle nodes with tag=10
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** bug. **What is the current behavior?** ```js renderer.create( <Fragment> <Fragment>foo</Fragment> </Fragment> ) .toTree() ``` > Invariant Violation: toTree() does not yet know how to handle nodes with tag=10 https://codesandbox.io/s/olky92m01y **What is the expected behavior?** returns a tree. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** 16.2.0
https://github.com/facebook/react/issues/12106
https://github.com/facebook/react/pull/12107
40a9e64e1f23e478036c5f302a60e5503ccf3a30
ef8d6d92a28835a8ab89a876f877306a5c3feffe
2018-01-27T15:52:20Z
javascript
2018-01-27T23:03:27Z
closed
facebook/react
https://github.com/facebook/react
12,072
["packages/react-dom/src/__tests__/ReactDOMTextarea-test.js", "packages/react-dom/src/client/ReactDOMTextarea.js"]
All controlled <textarea/> fields re-render on any setState() call even though their data has not changed.
**Do you want to request a *feature* or report a *bug*?** Reporting a bug. **What is the current behavior?** Basically I have many controlled `<textarea/>` fields in the app that I am currently developing and I normally only want them to re-render when their values have changed through their onChange event, but they re-render every time setState() gets called anywhere within the component or any parent component. I even tried creating a custom component which only contains a `<textarea/>` and setting shouldComponentUpdate() to return false but it seems to ignore that command completely. It's weird because in this case the console.log()s in my child component's render() function don't get executed but the field gets re-rendered nonetheless. This issue is causing some major performance problems in my app. I hope someone addresses this issue as fast as possible so I can continue working on my react project. Maybe someone can provide a temporary workaround? Please let me know if there's something I'm missing or if I'm using this field 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 (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:** I have isolated the problem in a new empty app and you can see the behavior in the following gif: https://gfycat.com/DentalExcitableIndri The code is very simple. You can recreate this problem by creating 2 controlled fields, one `<input/>` and another `<textarea/>`. Then go to your browser, inspect the `<textarea/>` element and input something in the basic input field. The `<textarea/>` will re-render on every new typed letter in the `<input/>` field but not the other way around. ```javascript import React, { Component } from 'react'; import logo from './logo.svg'; import './App.css'; class App extends Component { constructor(props){ super(props); this.state = { ta1 : "ta1", ta2 : "ta2", ta3 : "ta3", i1 : "i1", i2 : "i2", i3 : "i3" }; this.handleInputChange = this.handleInputChange.bind(this); } handleInputChange(event){ this.setState({ [event.target.name] : event.target.value }); } render() { return ( <div className="App"> <header className="App-header"> <img src={logo} className="App-logo" alt="logo" /> <h1 className="App-title">Welcome to React</h1> </header> <p className="App-intro"> test </p> <div className="row"> <div className="column"> textareas <textarea value={this.state.ta1} name="ta1" onChange={this.handleInputChange}/> <textarea value={this.state.ta2} name="ta2" onChange={this.handleInputChange}/> <textarea value={this.state.ta3} name="ta3" onChange={this.handleInputChange}/> </div> <div className="column"> input fields <input value={this.state.i1} name="i1" onChange={this.handleInputChange}/> <input value={this.state.i2} name="i2" onChange={this.handleInputChange}/> <input value={this.state.i3} name="i3" onChange={this.handleInputChange}/> </div> </div> </div> ); } } export default App; ``` **What is the expected behavior?** The `<textarea/>` field should only re-render when its data is changed. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** I was able to recreate this problem on React versions 16.2.0 (latest) and 15.6.1. I did not test on other versions so I am not sure if this worked correctly before. I'm using Chrome 62.0.3202.94 64-bit (latest) and Firefox 57.0.4 64-bit (latest) on Ubuntu 14.04.
https://github.com/facebook/react/issues/12072
https://github.com/facebook/react/pull/13643
0c9c591bfb4c280d69bc9c1dd692ab0028bb0f8e
d92114b98e8509a9fac8ad4f56110020fa8d6987
2018-01-22T17:45:57Z
javascript
2018-09-14T23:09:07Z
closed
facebook/react
https://github.com/facebook/react
12,062
["fixtures/dom/src/components/fixtures/text-inputs/ReplaceEmailInput.js", "fixtures/dom/src/components/fixtures/text-inputs/index.js", "packages/react-dom/src/client/ReactInputSelection.js"]
Problem when input type changes from email to text
**Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** When an input field changes from "email" to "text", an exception TypeError will be thrown from setSelection. ![Screenshot](https://raw.githubusercontent.com/adrianimboden/react-bug-reproduction/master/screenshot.png) **Reproduction** See here: https://github.com/adrianimboden/react-bug-reproduction **What is the expected behavior?** It should not crash because of an uncaught exception **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** master (https://github.com/facebook/react/commit/4ca7855ca062d5d7dfca83c86acf46731e1e57ef) Firefox This would be my proposed change to fix the issue: https://github.com/adrianimboden/react/commit/db923b8c3c1cb23ad9fb150c160ce56f39dd3cae
https://github.com/facebook/react/issues/12062
https://github.com/facebook/react/pull/12135
79a740c6e32ca300d4e7ff55ab06de172d4237fd
e0a03c1b4d84453122c4e9d1a5e0cec52bef9066
2018-01-20T17:17:02Z
javascript
2018-05-30T11:08:21Z
closed
facebook/react
https://github.com/facebook/react
12,058
["packages/shared/__tests__/describeComponentFrame-test.js", "packages/shared/describeComponentFrame.js"]
__source makes component stack less useful
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** Somewhere in between. **What is the current behavior?** When I enable `babel-plugin-transform-react-jsx-source` to automatically add a `__source` prop to every component in development, the component stack displayed for certain React warnings changes from displaying the (inferred) name of the rendering component to displaying the filename and line number of the occurrence. React also has access to the file path, but [it is stripped](https://github.com/facebook/react/blob/30dac4e78de02fb427ee82013160ae875128d7a2/packages/shared/describeComponentFrame.js#L20) and only the filename is included. This seems to be based on the assumption that the name of a file always maps exactly to the name of the component it exports. In practice, many people place components in `ComponentName/index.js`, so `__source` currently makes the stack _less_ useful. For example, compare: ``` in DownloadDropdown (created by Foo) in Foo (created by Bar) in div (created by Bar) in div (created by Bar) in div (created by Section) in section (created by Section) in Section (created by Bar) in div (created by App) in main (created by App) ... ``` to: ``` in DownloadDropdown (at index.js:53) in Foo (at index.js:183) in div (at index.js:182) in div (at index.js:175) in div (at index.js:29) in section (at index.js:28) in Section (at index.js:173) in div (at index.js:26) in main (at index.js:24) ... ``` **What is the expected behavior?** I would like the stack to include the full file path, or at least to include the inferred component name alongside the filename. Would you accept a PR for either option? **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React 16.2.0. This was introduced in #6771 for 15.2.0.
https://github.com/facebook/react/issues/12058
https://github.com/facebook/react/pull/12059
067cc24f55ef01a233be9e7564b337e35fed72ea
54d86eb8227255b207c8a82619d374738b542ca8
2018-01-20T00:32:03Z
javascript
2018-08-09T02:33:30Z
closed
facebook/react
https://github.com/facebook/react
12,044
["packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.internal.js", "packages/react-reconciler/src/ReactFiberClassComponent.js", "packages/react-reconciler/src/ReactFiberScheduler.js", "packages/react-reconciler/src/ReactStrictModeWarnings.js", "packages/react/src/__tests__/createReactClassIntegration-test.internal.js"]
Coalesce warnings for deprecated lifecycle hooks
Coalesce warnings for deprecated lifecycle hooks and print single message after reconciliation (rather than one per component-type). Relates to PR #12028 and [this comment](https://github.com/facebook/react/pull/12028#discussion_r162420575).
https://github.com/facebook/react/issues/12044
https://github.com/facebook/react/pull/12084
87ae211ccd8d61796cfdef138d1e12fb7a74f85d
6dabfca5774b9b2ceaa1faf8ad225e6dac016c31
2018-01-18T20:44:46Z
javascript
2018-01-25T05:41:40Z
closed
facebook/react
https://github.com/facebook/react
12,038
["packages/react-is/README.md", "packages/react-is/index.js", "packages/react-is/npm/index.js", "packages/react-is/package.json", "packages/react-is/src/ReactIs.js", "packages/react-is/src/__tests__/ReactIs-test.js", "scripts/rollup/bundles.js", "scripts/rollup/results.json", "scripts/rollup/validate/eslintrc.umd.js"]
Add React.isFragment api for verifying Fragment
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** I want to request a feature. **What is the current behavior?** We have no API to verify a ReactNode is a React 16 Fragment. Though now we can use `React.isValidElement(instance) && typeof instance.type === 'symbol'` to distinguish it. It's verbose and seems uncertianly right. **What is the expected behavior?** Add api: ``` React.isFragment(object) ``` Verifies the object is a React.Fragment. Returns true or false. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React 16.2
https://github.com/facebook/react/issues/12038
https://github.com/facebook/react/pull/12199
c7ce0091dcb2036e19df980247c9a4388ad75741
41b8c65f1e81ba48192fbb65fd5c742638ef4f82
2018-01-18T08:02:52Z
javascript
2018-02-11T22:08:40Z
closed
facebook/react
https://github.com/facebook/react
11,991
["packages/react-dom/src/__tests__/ReactCompositeComponent-test.js", "packages/react-dom/src/__tests__/ReactServerRendering-test.js", "packages/react-dom/src/server/ReactPartialRenderer.js", "packages/react-reconciler/src/ReactFiberBeginWork.js"]
Warn in server renderer if class doesn't extend React.Component but has a render() method
Same as https://github.com/facebook/react/issues/10103, but for the server renderer. You can look at implementation in https://github.com/facebook/react/pull/11168 and do something very similar in `ReactPartialRenderer.js`.
https://github.com/facebook/react/issues/11991
https://github.com/facebook/react/pull/11993
77f96ed9c389e4d07efa1da79d7d59951d37d5f1
e6e393b9c5221bfb1a5ddcc7221c42e96ab3baca
2018-01-08T15:29:56Z
javascript
2018-01-09T16:24:49Z
closed
facebook/react
https://github.com/facebook/react
11,975
["scripts/circleci/test_coverage.sh", "scripts/circleci/test_entry_point.sh"]
Re-enable coverage
See https://github.com/facebook/react/pull/11974, https://github.com/facebook/jest/issues/5239. Jest OOM’d so I disabled it.
https://github.com/facebook/react/issues/11975
https://github.com/facebook/react/pull/11983
08c86dd76b8cdde2805c72a7609cc0b0c264a71e
26185759e4f05025b1fdbe5e238a44aefe5669d4
2018-01-05T19:00:01Z
javascript
2018-01-08T02:27:24Z
closed
facebook/react
https://github.com/facebook/react
11,964
["packages/react-test-renderer/src/ReactShallowRenderer.js", "packages/react-test-renderer/src/__tests__/ReactShallowRenderer-test.js"]
State initialization disparity between shallow renderer and ReactDOM
**Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** The shallow renderer defaults a class component's state to empty object if it's not set. "Real" renderers don't seem to do this, so a component can render successfully in the shallow renderer, but fail at runtime in the browser with a null reference error. **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.** Here is ReactDOM's behavior (crashes reading an uninitialized state value): https://codesandbox.io/s/4jv82zmp0 Here is the shallow renderer behavior (component able to render): https://codesandbox.io/s/pp733nrxzq **What is the expected behavior?** They initialize state in the same way. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React 16. This wasn't an issue in React 15.
https://github.com/facebook/react/issues/11964
https://github.com/facebook/react/pull/11965
808f31af5cc571880058281c3ba1e1c69ce8aa5c
39be83565c65f9c522150e52375167568a2a1459
2018-01-04T22:38:24Z
javascript
2018-01-05T18:44:44Z
closed
facebook/react
https://github.com/facebook/react
11,963
["fixtures/attribute-behavior/package.json", "fixtures/dom/package.json", "fixtures/expiration/package.json", "fixtures/expiration/yarn.lock", "scripts/rollup/results.json"]
On running yarn start or npm start for fixtures is throwing error.
![yarnerror-1](https://user-images.githubusercontent.com/5938110/34579825-a04d453c-f1b0-11e7-85d1-458e6a9001f2.jpg) <!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** A bug **What is the current behavior?** on running npm start or yarn start in "react/fixtures/dom is throwing errors in terminal. **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 (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:** 1.Go to react/fixtures/dom 2. Run yarn start or npm start Following errors can be seen in the terminal `> [email protected] prestart /home/gmadmin/Practice/react/fixtures/dom > cp ../../build/dist/{react,react-dom}.development.js public/ cp: cannot stat '../../build/dist/{react,react-dom}.development.js': No such file or directory npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] prestart: `cp ../../build/dist/{react,react-dom}.development.js public/` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] prestart script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/gmadmin/.npm/_logs/2018-01-04T18_32_47_442Z-debug.log ` Note: I have already run npm run build in the react parent directory and i can see react.development.js and react-dom.development.js in react/build/dist/. Running "cp ../../build/dist/{react,react-dom}.development.js public/" this command on terminal works fine. But when it fails when run through "prestart" command in package.json. **What is the expected behavior?** copying should happen successfully and npm start should successfully turn up the server. **Which versions of React, and which browser / OS are affected by this issue? React "version": "16.2.0", kernel : "4.4.0-53-generic GNU/Linux" os info: { Distributor ID: LinuxMint Release: 18.1 Codename: serena} Did this work in previous versions of React? Don't know If its a bug, let me work on it.
https://github.com/facebook/react/issues/11963
https://github.com/facebook/react/pull/11982
13c5e2b53112c1cd77dd52e028a4bb33dc492d1b
77f96ed9c389e4d07efa1da79d7d59951d37d5f1
2018-01-04T19:09:51Z
javascript
2018-01-09T11:15:09Z
closed
facebook/react
https://github.com/facebook/react
11,955
["CHANGELOG.md"]
`react-call-return`: Expected to find a host parent.
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** A specific order of unmounting and remounting `unstable_createReturn`s from `react-call-return` causes an invariant violation in `unmountHostComponents`. **Reproduce** The following sandbox example crashes with an invariant violation when both the `min` and `cycle` props are *odd* numbers greater than zero. https://codesandbox.io/s/llyjz19rz7 **What is the expected behavior?** The app does not crash and cycles the number of items in the list. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** `react` and `react-dom` versions 16.1 and newer, `react-call-return` version 0.5.0
https://github.com/facebook/react/issues/11955
https://github.com/facebook/react/pull/12488
8e3d94ffa1d2e19a5bf4b9f8030973b65b0fc854
2c3f5fb97b6ea077f3e9aae6c6587bfe8328036d
2018-01-03T15:16:26Z
javascript
2018-03-29T20:56:45Z
closed
facebook/react
https://github.com/facebook/react
11,918
["packages/react-dom/src/client/ReactDOMFiberComponent.js", "packages/react-dom/src/client/ReactDOMHostConfig.js"]
Click events don't bubble from Portal content on mobile Safari
**Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** In mobile Safari, DOM events originating from elements rendered through a Portal do **not** bubble (propagate) up the React component tree. **If the current behavior is a bug, please provide the steps to reproduce....** Please see the following JSFiddle: https://jsfiddle.net/zebulonj/wf7orwan/ In this JSFiddle, the expected behavior (seen in a desktop browser) is that clicking on the portal content (appearing as a modal, including backdrop) should toggle to the "On" or "Off" indicator rendered in the main content. However, in mobile Safari (iOS 11.1.1), the click events do not propagate. **What is the expected behavior?** Click events should propagate up the React component tree. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** Affected: React 16.2 iOS 11.1.1
https://github.com/facebook/react/issues/11918
https://github.com/facebook/react/pull/11927
0da5102cf02890a4e006f4d949ae4fbf2bfd85af
b3a4cfea577e3333941a7cb2b01d2b957988e00b
2017-12-24T17:20:21Z
javascript
2018-08-18T01:10:20Z
closed
facebook/react
https://github.com/facebook/react
11,911
["fixtures/dom/src/components/fixtures/selects/index.js", "packages/react-dom/src/__tests__/ReactDOMOption-test.js", "packages/react-dom/src/__tests__/ReactDOMSelect-test.js", "packages/react-dom/src/__tests__/ReactDOMServerIntegrationForms-test.js", "packages/react-dom/src/__tests__/utils/ReactDOMServerIntegrationTestUtils.js", "packages/react-dom/src/client/ReactDOMFiberOption.js", "packages/react-dom/src/client/ReactDOMHostConfig.js"]
React DOM crashes when <option> contains three interpolated value if one is a conditional.
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** React DOM crashes when `<option>` contains three interpolated value if one is a conditional. Reproduction: https://jsfiddle.net/0opjvycp/ 1. Change the value of the `<select>` 2. React crashes with `NotFoundError: Node was not found` From what I can tell, the conditional value is necessary, and it must be three interpolated values. **What is the expected behavior?** React should not crash. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React DOM 16.2 and 16.0. I think this worked in 15.6 - https://jsfiddle.net/mrwkmuqc/ does not crash
https://github.com/facebook/react/issues/11911
https://github.com/facebook/react/pull/13261
2a2ef7e0fd86612404676b15bb3dd9df7ade536e
0182a74632b66a226921ca13dcfe359c67e15c6f
2017-12-22T12:10:29Z
javascript
2018-08-01T15:16:34Z
closed
facebook/react
https://github.com/facebook/react
11,902
["packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js", "packages/react-dom/src/server/ReactPartialRenderer.js"]
Provide a better message when component type is undefined with SSR
This might be a reference to this one: https://github.com/facebook/react/issues/10212#issuecomment-346302374 The problem still exist. So, trying to render with server side and got this error. I don't have this notation in my code but this might be a problem with dependencies. ``` TypeError: Cannot read property 'toLowerCase' of undefined at ReactDOMServerRenderer.renderDOM (/Users/lukasborawski/Dev/web-client/node_modules/react-dom/cjs/react-dom-server.node.development.js:2304:27) ... ``` ``` "react": "^16.1.1", "react-dom": "^16.2.0", ``` Thx for help.
https://github.com/facebook/react/issues/11902
https://github.com/facebook/react/pull/11966
f828ca407febc6287011f8ae89aa469c4d522fcc
86914cb30a7654d13a17d34a3b3a5af97c2d2855
2017-12-21T14:55:26Z
javascript
2018-02-05T17:09:09Z
closed
facebook/react
https://github.com/facebook/react
11,862
["packages/react-test-renderer/src/ReactShallowRenderer.js", "packages/react-test-renderer/src/__tests__/ReactShallowRenderer-test.js"]
ShallowRenderer not considering contextTypes when rendering children
**Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** ShallowRenderer not considering contextTypes. **Note: I was not able to easily include react-test-renderer in a fiddle so I include a unit test. ``` //Context used in shallow and normal rendering const context = { appName: 'abc', mode: 'def' }; class TopLevelComponent extends React.Component { render() { return <div>{this.props.children}</div>; } getChildContext() { return context; } } TopLevelComponent.childContextTypes = { appName: PropTypes.string, mode: PropTypes.string }; class Component1 extends React.Component { render() { return <div mode={this.context.mode} appname={this.context.appName}/>; } } Component1.contextTypes = { appName: PropTypes.string }; //Use shallow renderer and assert that we got appName but not mode const shallowComponent1 = new ShallowRenderer().render(<Component1/>, context); expect(shallowComponent1.props.appname).toBe('abc'); //Pass expect(shallowComponent1.props.mode).toBeUndefined(); //This expectation fails //Render Component1 under a component with childContext const wrappedEl = React.createElement(() => <TopLevelComponent><Component1/></TopLevelComponent>); const domNode = document.createElement('div'); ReactDOM.render(wrappedEl, domNode); const html = domNode.innerHTML; expect(html).toContain('abc'); //Pass expect(html).not.toContain('def'); //Pass: As you can see this property is undefined ``` **What is the expected behavior?** I would expect that when rendering Component1 with ShallowRenderer, render method would check Component1.contextTypes and mask any property that is not specified there just like function getMaskedContext(workInProgress, unmaskedContext) does in react-dom library. I fixed this behavior by changing render method like this: (inpired again by getMaskedContext) ``` const oldRender = ShallowRenderer.prototype.render; ShallowRenderer.prototype.render = function render(element) { const unmaskedContext = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; if (element && element.type && unmaskedContext) { if (element.type.hasOwnProperty('contextTypes')) { const context = {}; for (const key in element.type.contextTypes) { context[key] = unmaskedContext[key]; } arguments[1] = context; } } return oldRender.apply(this, arguments); }; ``` **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** This bug is for version 16. We are upgrading from React 15, we were using enzyme shallow rendering and this wasn't the behavior. It is difficult to say which part of the code has changed between React 15 and enzyme at this point but my code sample includes only code from react libraries.
https://github.com/facebook/react/issues/11862
https://github.com/facebook/react/pull/11922
39be83565c65f9c522150e52375167568a2a1459
9d310e0bc7b9d5ce39d82536dfcb67f98462a346
2017-12-15T12:26:55Z
javascript
2018-01-05T18:49:57Z
closed
facebook/react
https://github.com/facebook/react
11,858
["fixtures/attribute-behavior/AttributeTableSnapshot.md", "fixtures/attribute-behavior/src/attributes.js", "packages/react-dom/src/shared/DOMProperty.js", "packages/react-dom/src/shared/possibleStandardNames.js"]
add support for nomodule attribute on the script tag
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** feature: add support for the [nomodule](https://hospodarets.com/native-ecmascript-modules-nomodule) attribute to the script tag. **What is the current behavior?** with `<script nomodule src="foo.js" />` i get: ``` Warning: Received `true` for a non-boolean attribute `nomodule`. If you want to write it to the DOM, pass a string instead: nomodule="true" or nomodule={value.toString()}. ``` and the attribute is removed. **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).** https://jsfiddle.net/hzdkwne6/ **What is the expected behavior?** the `nomodule` attribute should be respected **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** react 16.2.0 chrome osx not a regression, i don't think it's ever worked before. if this isn't an intentional oversight i'll open a pr to add it, seems like it's just a change to https://github.com/facebook/react/blob/master/fixtures/attribute-behavior/src/attributes.js ?
https://github.com/facebook/react/issues/11858
https://github.com/facebook/react/pull/11900
faa4218632ca21f3af731fb6c14849fc054fca15
9ff3ce67eaf07e8f62704133a8d748f1c0679a59
2017-12-14T19:52:27Z
javascript
2017-12-22T18:18:51Z
closed
facebook/react
https://github.com/facebook/react
11,807
["packages/react-dom/src/__tests__/ReactServerRenderingHydration.js", "packages/react-dom/src/client/ReactDOMComponent.js"]
False positive warning about style mismatch when hydrating server markup in IE11
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** Bug? (not a biggy - not sure if IE11 is support for development) **What is the current behavior?** IE11 seems to always throw a warning for hydration failures eg > **Warning: Prop `style` did not match. Server: "text-decoration: none;" Client: "text-decoration:none"** Note: there is a space between the colon and none from Server, Client has no space **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).** Have a SSR rendered component, using inline styles ``` <a href="/page1" style={{ textDecoration: "none" }}> <h1 className="splash-head">Go to Page1</h1> </a> ``` Then hydrate it on IE11 `ReactDOM.hydrate(component, document.getElementById("app"));` This **doesnt** occur in either Chrome or Firefox **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?** React: 16.1.1 Browser: IE11
https://github.com/facebook/react/issues/11807
https://github.com/facebook/react/pull/13534
25d48a7281bcb2c51927c562a43295b8ce0bd983
2d4705e7532d32147da8ee61e5760124d068a8a6
2017-12-08T02:20:24Z
javascript
2018-09-04T13:26:51Z
closed
facebook/react
https://github.com/facebook/react
11,795
["packages/react-dom/src/__tests__/ReactDOMSelect-test.js", "packages/react-dom/src/client/ReactDOMFiberOption.js"]
Select warning fires repeatedly
<!-- Note: if the issue is about documentation or the website, please file it at: https://github.com/reactjs/reactjs.org/issues/new --> **Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** See fiddle https://jsfiddle.net/j2nzg31L/1/ The warning related to the select fires repeatedly. @gaearon tells me it should dedupe, and that this is a bug. **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).** See above **What is the expected behavior?** See above **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** 16.2
https://github.com/facebook/react/issues/11795
https://github.com/facebook/react/pull/11821
f23dd7150f270c843707f1a06ac12a6af63b7320
51e3f498a20572ecd5360c0460da212903a089bb
2017-12-07T16:52:54Z
javascript
2017-12-10T02:06:41Z
closed
facebook/react
https://github.com/facebook/react
11,789
["packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js", "packages/react-dom/src/__tests__/ReactDOMServerIntegrationReconnecting-test.js", "packages/react-dom/src/client/ReactDOMFiberComponent.js", "packages/react-dom/src/client/ReactDOMHostConfig.js"]
hydrating a component with `dangerouslySetInnerHTML` and `toString` causes a warning, and the component to not render
**Do you want to request a *feature* or report a *bug*?** bug **What is the current behavior?** When hydrating a pre-rendered component that uses `dangerouslySetInnerHTML`, + an object with a `toString` method, we get a warning such as: ``` Warning: Did not expect server HTML to contain the text node "Bonjour" in <p>. ``` The component will also appear blank. This is noteworthy since: - The markup returned by `render` appears to be correct, meaning: - The markup that an SSR server returns is correct - The markup that appears on page if we just use `render` on the client, without SSR is correct - It's only if we do both, that we get errors. **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).** https://codesandbox.io/s/vqkq34o965 (Code, for posterity:) ```js import React from "react"; import { hydrate } from "react-dom"; const HelloObj = { toString: () => "Bonjour" }; const MyComponent = () => ( <p dangerouslySetInnerHTML={{ __html: HelloObj }} /> ); hydrate(<MyComponent />, document.getElementById("app")); ``` **What is the expected behavior?** The component is not blank, and no error is outputted in the console **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** - react/react-dom 16.2.0 - This worked < 16 (confirmed working in 15.6.1, if we use the `render` method) - Chrome Version 62.0.3202.94 - OS X 10.12.6
https://github.com/facebook/react/issues/11789
https://github.com/facebook/react/pull/13353
0072b59984f0743b95664557c17904e8c0912ec5
be4533af7d29f020499d3c01931e55ef8666a419
2017-12-07T00:21:56Z
javascript
2018-08-09T17:05:05Z
closed
facebook/react
https://github.com/facebook/react
11,759
["packages/react/src/ReactElementValidator.js"]
"React.createElement: type is invalid" warning in IE11 when using React.Fragment
https://codesandbox.io/embed/j30o67kpxy React shows warning in console if I use React.Fragment ``` Warning: React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. ```
https://github.com/facebook/react/issues/11759
https://github.com/facebook/react/pull/11823
abdbb16d4bec5c444c2d8e69b508871ab1335793
a5025b161048c4e7211cf4c7298df7fcfc03bfa0
2017-12-04T08:56:34Z
javascript
2017-12-11T03:25:28Z
closed
facebook/react
https://github.com/facebook/react
11,726
["packages/react-dom/src/__tests__/ReactServerRendering-test.js", "packages/react-dom/src/client/ReactDOM.js"]
client/server mismatch for text inside of an a/button causes the the a/button to focus on page load
**Do you want to request a *feature* or report a *bug*?** bug **What is the current behavior?** If there is a client/server mismatch for text inside of an a or button element, it causes it to be automatically focused on page load. **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).** ``` let text; let URL = '/randomURL'; if (typeof window !== 'undefined') { text = 'CLIENT TEXT'; } else { text = 'TEXT'; } return ( <a href={URL}> {text} </a> ); ``` if the focus is not on the window (i.e. if a dom element is selected in the chrome inspector or react inspector widnow), then it doesn't add the focus. **What is the expected behavior?** The expected behavior is that it would either show CLIENT TEXT or TEXT (depending on how React16 resolves the diff), but for it not to be automatically highlighted **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React16 / macosx / chrome + ff + safari
https://github.com/facebook/react/issues/11726
https://github.com/facebook/react/pull/11737
5bd2321ae3dd7d68ac02dee3c3f271e9d0ee8784
19bc2dd090c44be862bae59c64e89acb8d0827f5
2017-11-30T19:53:33Z
javascript
2017-12-06T15:23:37Z
closed
facebook/react
https://github.com/facebook/react
11,692
["packages/react-dom/src/__tests__/ReactServerRendering-test.js", "packages/react-dom/src/server/ReactPartialRenderer.js"]
ReactDOMServer.renderToStaticMarkup gets stuck while trying to render Portals
Calling `ReactDOMServer.renderToStaticMarkup(elementWithPortal);` gets stuck in a loop while trying to do a static render. Current behavior: The behavior can be seen here: https://codepen.io/anon/pen/BmqWOM by un-commenting line 58 (warning: this will make your tab freeze) Expected behavior: It should return with results or throw some kind of error if the input is not valid
https://github.com/facebook/react/issues/11692
https://github.com/facebook/react/pull/11709
e0c31137434d7c7df2bc3475cb7682b1d7eecc8b
c3f1b6cd91ffa3e05465c3ed2f48225876c1bd3b
2017-11-28T21:36:13Z
javascript
2017-11-29T21:45:38Z
closed
facebook/react
https://github.com/facebook/react
11,687
["fixtures/dom/src/components/fixtures/error-handling/index.js", "packages/shared/invokeGuardedCallback.js"]
react-dom: Ability to access window.event in development
Imported from https://github.com/facebook/react/issues/10474#issuecomment-345331144 at request of @gaearon **Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** In development mode React uses `invokeGuardedCallback` to be able to catch errors without interrupting the normal "break on uncaught exceptions" feature of devtools. In the current implementation of `invokeGuardedCallback` an event is created and dispatched, which allows for error handling without a `try{ } catch` block. Unfortunately it has the side effect of overriding `window.event`, and so you are unable to access `window.event` within guarded callbacks when running React in development mode. In production mode it works fine. We would like to access window.event at Superhuman to be able to detect where DOM focus is from the user's point of view. Usually this is document.activeElement, but in a few cases (like during a blur event, or when clicking between two iframes) the focus will end up in a different place. This works fine in production, and we currently work around this in development mode by overriding `ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactDOMEventListener.handleTopLevel` and maintiaining a reference to the event. In production mode we just use window.event. **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).** in development: https://jsfiddle.net/n782L2qg/, in production: https://jsfiddle.net/kqt2o7pr/. In both cases I would expect the alert to say `window.event.type: click`, but in development it says `window.event.type: react-invokeguardedcallback` **What is the expected behavior?** I would like a way to access window.event in development. I'm happy for this to be somewhat obscure, but ideally I would not have to use the secret internals to make this work. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** Development 0.15 and 0.16 at least. probably before.
https://github.com/facebook/react/issues/11687
https://github.com/facebook/react/pull/11696
ade4dd3f6fb542677627001fe7e3477b27de96e2
69e2a0d732e1ca74f6dc5df9d0ddd0bf24373965
2017-11-28T20:33:31Z
javascript
2018-08-14T20:35:31Z
closed
facebook/react
https://github.com/facebook/react
11,660
["package.json", "scripts/circleci/build.sh", "scripts/release/build-commands/run-automated-bundle-tests.js", "scripts/release/build-commands/run-automated-tests.js", "scripts/release/build.js", "scripts/release/utils.js"]
Add bundle linting and tests to the release script
On CI, we currently lint bundles: https://github.com/facebook/react/blob/d1cb28c86b966cb33c373b532abe62dfe563d00e/scripts/circleci/build.sh#L11-L12 and then run both development and production bundle tests: https://github.com/facebook/react/blob/d1cb28c86b966cb33c373b532abe62dfe563d00e/scripts/circleci/test_entry_point.sh#L24-L25 We should add the first step (linting bundles) into a `package.json` script called `lint-build`. Then we can change the CI command to run `yarn lint-build`. Finally, we should add both `yarn lint-build`, `yarn test-prod`, `yarn test-build`, and `yarn test-build-prod` to the release script [into this function](https://github.com/facebook/react/blob/d1cb28c86b966cb33c373b532abe62dfe563d00e/scripts/release/build-commands/run-automated-tests.js#L23). <s>Note that this function is already broken. We need to replace `runYarnTask(cwd, 'jest', 'Jest failed'),` with `runYarnTask(cwd, 'test', 'Jest failed'),` too since just running `jest` no longer works due to a custom config. Just running `test` should work because we have a custom `test` script.</s> Never mind, I fixed this in https://github.com/facebook/react/commit/f53bd033e79994dbda112a091ddbf784a3c30aaf. To verify your changes, you can run `./scripts/release/build.js -v 16.2.0` and see that the whole workflow can run successfully. This task requires understanding of how `scripts` in `package.json` work.
https://github.com/facebook/react/issues/11660
https://github.com/facebook/react/pull/11662
f53bd033e79994dbda112a091ddbf784a3c30aaf
53ef71b8e8ba03058f99d57fcb1efe15956c3f36
2017-11-25T16:08:00Z
javascript
2017-11-26T16:47:20Z
closed
facebook/react
https://github.com/facebook/react
11,657
["circle.yml", "scripts/circleci/test_entry_point.sh"]
Investigate CI failure (possible race condition)
It looks like this: ``` ./scripts/circleci/upload_build.sh curl: (26) couldn't open file "build/dist/react.development.js" ./scripts/circleci/upload_build.sh returned exit code 26 Action failed: ./scripts/circleci/upload_build.sh ``` https://circleci.com/gh/facebook/react/7816?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link It happened two times on random commits, and I don't see a pattern. Probably caused by me changing how tasks are distributed between parallel nodes in https://github.com/facebook/react/pull/11633. I don't understand why `upload_build.sh` would try to run before a build exists though (if that's what's happening?)
https://github.com/facebook/react/issues/11657
https://github.com/facebook/react/pull/11666
53ef71b8e8ba03058f99d57fcb1efe15956c3f36
0c164bb4851e78e5f789dd8619f17ffcfee0221f
2017-11-25T03:17:17Z
javascript
2017-11-26T18:03:30Z
closed
facebook/react
https://github.com/facebook/react
11,656
["packages/react-dom/src/__tests__/InvalidEventListeners-test.js", "packages/react-dom/src/__tests__/ReactTestUtils-test.js", "packages/react-dom/src/test-utils/ReactTestUtils.js"]
Deprecate TestUtils.SimulateNative
I'm not sure if it was ever intended to be a part of public API. It's not documented, and its naming is misleading because it actually doesn't simulate a native event (oops!). It only simulates what React would do if it *received* that native event. It does that in a way that's very tightly coupled to the event system internals which is unfortunate. It is much better if we can educate people how to dispatch actual browser events in tests instead. I think we should just deprecate it. We've removed most tests relying on it, and can leave a test or two until it can be deleted in the next major.
https://github.com/facebook/react/issues/11656
https://github.com/facebook/react/pull/13407
4123d729e53d11f8a29c7665ce0f52308cca3bd4
e55855e7aee04b8e47edc319fc828b6cff43beed
2017-11-25T02:56:16Z
javascript
2020-04-02T22:48:03Z
closed
facebook/react
https://github.com/facebook/react
11,618
["packages/react-dom/src/__tests__/ReactDOMServerIntegration-test.js", "packages/react-dom/src/server/ReactPartialRenderer.js", "packages/react-reconciler/src/ReactFiberClassComponent.js", "packages/react/src/__tests__/ReactCoffeeScriptClass-test.coffee", "packages/react/src/__tests__/ReactES6Class-test.js", "packages/react/src/__tests__/ReactTypeScriptClass-test.ts"]
Investigate uncovered differences between development and production
Follow up from https://github.com/facebook/react/pull/11616. Here's one I found. These two invariants: https://github.com/facebook/react/blob/7e7127387ba64f57299eaff8656542cea6fb3a2d/packages/react-reconciler/src/ReactFiberClassComponent.js#L330-L343 are in a function that's behind a DEV block: https://github.com/facebook/react/blob/7e7127387ba64f57299eaff8656542cea6fb3a2d/packages/react-reconciler/src/ReactFiberClassComponent.js#L447-L449 I don't think this is intentional, but need to verify. There may be more. I'll use this issue to track while https://github.com/facebook/react/pull/11616 preserves existing behavior.
https://github.com/facebook/react/issues/11618
https://github.com/facebook/react/pull/11630
1cb6199d22af6f6ba2f55e4db18ed2f4216aaaf2
913a125ad51777ffec91eedefa03c534a7590395
2017-11-22T02:31:49Z
javascript
2017-11-22T18:58:53Z
closed
facebook/react
https://github.com/facebook/react
11,615
["scripts/tasks/linc.js"]
yarn linc shouldn't fail because of file-has-not-changed warning
Just saw this after modifying ESLint config and running `yarn linc`: ``` /Users/gaearon/p/react/.eslintrc.js 0:0 warning File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override ✖ 1 problem (0 errors, 1 warning) Lint failed for changed files. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. react) ``` We should not treat this particular warning as an error.
https://github.com/facebook/react/issues/11615
https://github.com/facebook/react/pull/11641
b542f42a0ff658eb383ac3b058c9805ade0ef034
7788bcdb26844a19c23d0f6d5ab4d20822e59c85
2017-11-21T20:40:42Z
javascript
2017-11-28T13:54:46Z
closed
facebook/react
https://github.com/facebook/react
11,593
["packages/react-dom/src/__tests__/ReactComponentLifeCycle-test.js", "packages/react-reconciler/src/ReactFiberClassComponent.js"]
Warn if this.state is set to this.props referentially
See this example: https://github.com/facebook/react/issues/11508#issuecomment-345464797. I think it probably reflects a misunderstanding of how props and state work, and we should detect and warn if we see this.
https://github.com/facebook/react/issues/11593
https://github.com/facebook/react/pull/11658
29287f08867e72c0f4a6a6f7523e966009520308
672e859d311536ddf5f09fb47dcb84007703aa65
2017-11-18T19:24:43Z
javascript
2018-08-28T13:17:44Z
closed
facebook/react
https://github.com/facebook/react
11,544
["scripts/release/utils.js"]
Ignore system directories in the build script
Just noticed that running `./scripts/release/build.js -v 16.1.1` gives me: ``` ERROR ENOTDIR: not a directory, open '/Users/gaearon/p/react/packages/.DS_Store/package.json' Error: at Object.fs.openSync (fs.js:653:18) at fs.readFileSync (fs.js:554:33) at readdirSync.filter.dir (/Users/gaearon/p/react/scripts/release/utils.js:31:36) at Array.filter (<anonymous>) at getPublicPackages (/Users/gaearon/p/react/scripts/release/utils.js:29:36) ``` We should ignore system directories there.
https://github.com/facebook/react/issues/11544
https://github.com/facebook/react/pull/11546
200db83850257fe2e18d0212a1f96c59c02deb99
2d23a4563ef2bec7d90c4a7edff2657c890b4334
2017-11-13T15:58:01Z
javascript
2017-11-13T18:21:17Z
closed
facebook/react
https://github.com/facebook/react
11,526
["packages/react-dom/server.browser.js", "packages/react-dom/server.node.js", "packages/react-dom/src/server/ReactDOMServerBrowser.js", "packages/react-dom/src/server/ReactDOMServerNode.js"]
Transpilation in v16.1.0 freezes the react-dom/server interface
As initially reported in https://github.com/facebook/react/issues/11520#issuecomment-343593640, attempting to upgrade from v16.0 to v16.1 caused a test that was previously working to fail. The test was using [sinon](http://sinonjs.org/) to stub `renderToStaticMarkup` on `react-dom/server` and v16.1 results in the following error: ``` TypeError: Cannot redefine property: renderToStaticMarkup at Function.defineProperty (<anonymous>) at wrapMethod (node_modules/sinon/lib/sinon/util/core/wrap-method.js:92:16) at stub (node_modules/sinon/lib/sinon/stub.js:60:44) at Object.stub (node_modules/sinon/lib/sinon/collection.js:102:33) at Context.setup (test/unit/....) ``` the export from `react-dom/cjs/react-dom-server.node.development` is frozen as: ```js Object.freeze({ renderToString: renderToString, renderToStaticMarkup: renderToStaticMarkup, renderToNodeStream: renderToNodeStream, renderToStaticNodeStream: renderToStaticNodeStream, version: version }); ``` [the source](https://github.com/facebook/react/blob/13c491a8282cb102c40d4ed74738ebebe7901a5f/packages/react-dom/src/server/ReactDOMServerNode.js#L17-L22) is not frozen, and https://github.com/facebook/react/issues/11520#issuecomment-343604002 further confirms that the `Object.freeze()` is a result of the transpilation. for now, i am simply splitting this report into a separate issue from https://github.com/facebook/react/issues/11520, but i will add a reproduction soon and plan to submit a PR as a follow up.
https://github.com/facebook/react/issues/11526
https://github.com/facebook/react/pull/11531
2fe3494f0d6d42f8a0a4dd7a196d01a191b93f90
901a091fe04ca5ad1fb9f825e9df39881a87debc
2017-11-11T04:00:34Z
javascript
2017-11-13T13:52:59Z
closed
facebook/react
https://github.com/facebook/react
11,519
["packages/shared/__tests__/describeComponentFrame-test.js", "packages/shared/describeComponentFrame.js"]
Consider including directory name into the stack trace for some files
See https://twitter.com/deadcoder0904/status/929050109425229824 Maybe if the file is called `index.js` (pretty common with some directory structures) we should include the directory name into the short component stack trace.
https://github.com/facebook/react/issues/11519
https://github.com/facebook/react/pull/12059
067cc24f55ef01a233be9e7564b337e35fed72ea
54d86eb8227255b207c8a82619d374738b542ca8
2017-11-10T19:51:16Z
javascript
2018-08-09T02:33:30Z
closed
facebook/react
https://github.com/facebook/react
11,496
["packages/react-dom/src/__tests__/ReactCompositeComponent-test.js", "packages/react-test-renderer/src/ReactShallowRenderer.js", "packages/react-test-renderer/src/__tests__/ReactShallowRenderer-test.js"]
SetState callback called before component state is updated in React Shallow Renderer
**Do you want to request a *feature* or report a *bug*?** report a bug **What is the current behavior?** When I call setState with a callback in a test using react shallow renderer (via enzyme), the callback gets called and `this.state` is still the old state. EDIT: This seems limited to componentWillMount **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).** EDIT: Reproduce with this https://github.com/bdwain/setstate-callback-bug **What is the expected behavior?** When the setState callback gets called, it should have access to the new state. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** Version 16. It worked in v15 with enzyme 2. EDIT: I think this is because in componentWillMount, [this line](https://github.com/facebook/react/blob/master/packages/react-test-renderer/src/ReactShallowRenderer.js#L67) causes the render method in the shallow wrapper to return early, before it updates the state.
https://github.com/facebook/react/issues/11496
https://github.com/facebook/react/pull/11507
913a125ad51777ffec91eedefa03c534a7590395
f114bad09f7a3ddc11265741cb84250fd08d5890
2017-11-09T00:35:37Z
javascript
2017-11-22T22:15:11Z
closed
facebook/react
https://github.com/facebook/react
11,481
["scripts/release/publish-commands/print-post-publish-summary.js", "scripts/release/publish-commands/publish-to-npm.js"]
Release script follow-up
- [X] #11482: Add a timeout before querying npm right after publish - [X] #11482: Conditionally log some post publish steps - [X] #11482: Maybe print ready-to-paste `yarn add ...` instructions for CRA prerelease testing - [x] #11504: Publish all packages that aren't `private` and remove the whitelist in config - [x] #11504: Add "v" prefix for release tags - [x] #11504: Nit: seconds => minutes for long tasks 😉
https://github.com/facebook/react/issues/11481
https://github.com/facebook/react/pull/11482
a2ec771360966f7a9b91698a7626931cbc7f9105
8a0285fb43a3109aa7cd7b31ad91b007910fc5f8
2017-11-07T15:06:27Z
javascript
2017-11-08T19:59:26Z
closed
facebook/react
https://github.com/facebook/react
11,460
["packages/react-dom/src/shared/DOMProperty.js"]
Check .length before accessing characters
See comment here: https://github.com/facebook/react/pull/11457#discussion_r148954193. Although it seems very unlikely that someone would pass a one-character prop, the price (at least in versions of V8 in Chrome right now) is reported to be about 10x. So we should check `.length` first and then do the comparison. **Please comment if you want to take this issue.** **If somebody already commented, please let them finish it.**
https://github.com/facebook/react/issues/11460
https://github.com/facebook/react/pull/11462
92b7b172cce9958b846844f0b46fd7bbd8c5140d
e2e7fcce7e137e6e6fbc23cfadea1a0abaa0e6ce
2017-11-05T12:01:09Z
javascript
2017-11-05T14:46:46Z
closed
facebook/react
https://github.com/facebook/react
11,454
["package.json", "scripts/rollup/build.js", "yarn.lock"]
Improve formatting of errors when building React
Currently when the build fails (e.g. due to a missing named export), the message is pretty ugly: <img width="1033" alt="screen shot 2017-11-04 at 13 12 31" src="https://user-images.githubusercontent.com/810438/32405680-d618d2e6-c161-11e7-9b91-e0241c7c3eed.png"> It would be nice to display the relevant line inline with syntax highlighting, sort of like Babel does it. Maybe Babel's `babel-code-frame` could be helpful (not sure). To reproduce, fail the build by removing some `export` somewhere and run `yarn build`. (Tip: `yarn build core --type=NODE_DEV` is the fastest way to build just `packages/react/*` and that might be enough to reproduce and iterate on the error message.) The relevant logic for displaying build errors is probably somewhere in `scripts/rollup/build.js`. **If you'd like to work on this please comment here, so we don't have many people working on the same thing.**
https://github.com/facebook/react/issues/11454
https://github.com/facebook/react/pull/11456
aa0b7418c17847552971441337c51d71f2ea5fc9
962042f82713b7d8fc61165cf4480801cbbd1f67
2017-11-04T13:14:57Z
javascript
2017-11-19T14:23:33Z
closed
facebook/react
https://github.com/facebook/react
11,444
["package.json", "scripts/tasks/linc.js"]
Fix `yarn linc` command on Windows
It currently fails on Windows because it depends on grep: https://github.com/facebook/react/blob/61d35ce1f3f9c0706ed3630a2650d578497ae8c2/package.json#L101 We should find a way to make it do the same in a cross platform way (e.g. from a Node script).
https://github.com/facebook/react/issues/11444
https://github.com/facebook/react/pull/11447
366600d0b2b99ece8cd03d60e2a5454a02857502
743201387246d0cde523700c151550786f0afc2e
2017-11-03T18:33:45Z
javascript
2017-11-04T18:09:28Z
closed
facebook/react
https://github.com/facebook/react
11,443
["scripts/rollup/validate/index.js"]
Ensure linted bundles exist
I added validation of built bundles in https://github.com/facebook/react/pull/11432. However I actually messed it up, and ESLint wasn't running on any files because of invalid arguments. I fixed that here: https://github.com/facebook/react/commit/61d35ce1f3f9c0706ed3630a2650d578497ae8c2#diff-edcddc0e0143d5a5a93d0951fd599794 We should fail the build if the glob patterns it's searching for don't exist.
https://github.com/facebook/react/issues/11443
https://github.com/facebook/react/pull/11452
028691b43d74d009c394cde16072d2b468dd88ef
da86a4553b2f8c71665b7d80e3405c1971451c2b
2017-11-03T18:17:10Z
javascript
2017-11-04T12:57:48Z
closed
facebook/react
https://github.com/facebook/react
11,441
["packages/react-test-renderer/src/ReactShallowRenderer.js", "packages/react-test-renderer/src/__tests__/ReactShallowRenderer-test.js"]
Remove support for cloneElement(getMountedInstance()) in shallow renderer
There was a test added as part of shallow renderer rewrite (#9426) in https://github.com/facebook/react/pull/9426/commits/fc1c6f913cb74a2cb1ce1cfe6ba91b431786c4ac that I don’t understand. It tests that you can take an *instance*, call `cloneElement` on it, and pass the result to the shallow renderer. If we are doing this internally this seems like a misunderstanding of how the API should work, and we need to fix those callsites to read `getRenderOutput()` instead of `getMountedInstance()`. You can see the test is wrong because if you change it to render to a *different* shallow renderer like this ```js const shallowRenderer = createRenderer(); let result = shallowRenderer.render(<SimpleComponent foo="foo" />); expect(result).toEqual(<div>foo:bar</div>); const instance = shallowRenderer.getMountedInstance(); const shallowRenderer2 = createRenderer(); const cloned = React.cloneElement(instance, {foo: 'baz'}); result = shallowRenderer2.render(cloned); expect(result).toEqual(<div>baz:bar</div>); ``` it will fail with ``` TypeError: Cannot read property 'prototype' of undefined ``` The argument we’re passing in this case is **not** a proper React element and doesn’t actually have `element.type`. It just mostly “happens” to work because both React elements and ShallowRenderer instances have `.props` on them, and code almost doesn’t read anything else in the update path. This [is an example hack](https://github.com/facebook/react/blob/779d23f72e7f2c763f7a3e3373a4134c54356fd6/packages/react-test-renderer/src/ReactShallowRenderer.js#L147-L148) that we needed because of this. I think we should just delete this test, and fix the internal callsites. It was never intentionally supported, and prevents me from doing some other fixes in the shalllow renderer.
https://github.com/facebook/react/issues/11441
https://github.com/facebook/react/pull/11442
e8a382343aac011173a8eb68607e904d7ea26e40
fd47129ce6e8af37004686262bd27fa787af37fc
2017-11-03T14:22:34Z
javascript
2017-11-03T16:16:56Z
closed
facebook/react
https://github.com/facebook/react
11,435
["scripts/release/build-commands/add-git-tag.js", "scripts/release/build-commands/print-post-build-summary.js", "scripts/release/build-commands/update-package-versions.js", "scripts/release/build.js", "scripts/release/publish-commands/publish-to-npm.js"]
Release script follow-up items
Today I used the [new release script](https://github.com/facebook/react/tree/master/scripts/release) for the first time to publish `16.1.0-beta`. Here are a couple of things I noticed that I want to follow-up on: ### PR #11434 - [x] Auto-install (or update) release script Yarn deps before running ### PR #11437 - [x] `publish` script should `git tag -a ${version}`. I manually tagged the `16.1.0-beta` release. - [X] The post-build test instructions should show fully-qualified paths to prevent you from accidentally verifying the wrong build (eg the checkout the release script is running from rather than the `-p` path) - [x] `publish-to-npm` check should handle pre-1.0 packages. (This one failed for the `0.2.0` reconciler release b'c it expected it to be 16.1.0-beta.) For that matter, it should have probably been `0.2.0-beta` - [x] When publishing a stable release (`@latest`) also update the next release to point to it.
https://github.com/facebook/react/issues/11435
https://github.com/facebook/react/pull/11437
43a1e0d084ce4491e7c61bb2b6ae9c768a1f4fad
af08b5cbcaf4d3e3ad965a9165e41688733a7771
2017-11-02T22:57:15Z
javascript
2017-11-03T20:19:32Z
closed
facebook/react
https://github.com/facebook/react
11,423
["packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js", "packages/react-dom/src/__tests__/ReactServerRenderingHydration.js", "packages/react-dom/src/client/ReactDOMHostConfig.js"]
Ignore <noscript> content on the client and don't warn about mismatches
React 16.0.0 with SSR & [lazysizes](https://github.com/aFarkas/lazysizes) 4.0.1. Trying to use the ["the noscript pattern"](https://github.com/aFarkas/lazysizes#the-noscript-pattern) to lazy load images with [lazysizes](https://github.com/aFarkas/lazysizes) but I'm seeing this: > Warning: Expected server HTML to contain a matching &lt;img&gt; in &lt;noscript&gt;. Image component render method: ```js render () { const { cdn, url, width, height } = this.props if (!url) return null const noScriptImgProps = { src: `${cdn}${url}`, className: classNames('product-image'), width, height } const imgProps = { 'data-src': `${cdn}${url}`, className: classNames('product-image', 'lazyload'), width, height } return ( <span> <noscript> <img {...noScriptImgProps} /> </noscript> <img {...imgProps} /> </span> ) } ``` Does React have an issue with `noscript` tags..?
https://github.com/facebook/react/issues/11423
https://github.com/facebook/react/pull/13537
8a1e3962ab189b99b1593d8431feabcb4a21211b
0b74e95d7b7fabbd0cf502d0f3254a607ed30478
2017-11-01T13:51:13Z
javascript
2018-09-03T16:17:53Z
closed
facebook/react
https://github.com/facebook/react
11,419
["packages/react-dom/src/shared/HTMLDOMPropertyConfig.js"]
Capture attribute only supports boolean values
This is a follow-up to #4784. The `capture` attribute on `input` elements is currently supported, but it is configured as a `HAS_BOOLEAN_VALUE` attribute: https://github.com/facebook/react/blob/1eed302d346bfb8f5db8d88b0e7096d8999d3548/packages/react-dom/src/shared/HTMLDOMPropertyConfig.js#L33 This causes ``` <input type="file" capture="user" /> ``` to render as ``` <input type="file" capture /> ``` The `capture` attribute supports strings though: https://www.w3.org/TR/html-media-capture/#the-capture-attribute This is very important for being able to configure the default camera selected on mobile devices.
https://github.com/facebook/react/issues/11419
https://github.com/facebook/react/pull/11424
acabf112454e5545205da013266d8529599a2a82
2fe3494f0d6d42f8a0a4dd7a196d01a191b93f90
2017-10-31T22:50:05Z
javascript
2017-11-12T14:29:27Z
closed
facebook/react
https://github.com/facebook/react
11,379
["packages/react-dom/src/events/SelectEventPlugin.js", "packages/react-dom/src/events/__tests__/SelectEventPlugin-test.js"]
onDrop breaks onSelect event
**Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** After an `onDrop` event has fired inside an "editable" element (input, textarea, contentEditable), the `onSelect` event on that element will no longer fire when changing selection using the keyboard. As you can see in this gif below, the onSelect event gets called each time I move the cursor around (using the arrow keys). But once the `onDrop` event has fired, `onSelect` will no longer fire when I move the cursor around (also using the keys): ![react-onselect-bug](https://user-images.githubusercontent.com/3599069/32080216-bd42f580-baae-11e7-98ee-93a482ed80ca.gif) [Here's the jsfiddle](https://jsfiddle.net/owmL8n6u/1/) I used to record the video above. **What is the expected behavior?** The `onSelect` event should always fire when selection changes. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React 16 / Chrome 62
https://github.com/facebook/react/issues/11379
https://github.com/facebook/react/pull/13422
146c9fb30763f84d85782dda82902f8513e70867
d14e443d6e97f6f4ca80d2e9a80300690b71e3c4
2017-10-26T22:46:34Z
javascript
2018-08-16T23:22:16Z
closed
facebook/react
https://github.com/facebook/react
11,348
["scripts/error-codes/replace-invariant-error-codes.js"]
Invariants that don't have error codes yet are missing in production builds
See my comment in https://github.com/facebook/react/pull/11291#issuecomment-338974574. I verified https://github.com/facebook/react/pull/11291 introduced this regression.
https://github.com/facebook/react/issues/11348
https://github.com/facebook/react/pull/11350
d5f26b041e6dfce97e80176a4e278225fc8e47c7
793a28d69895c88d08ac1165e403125502df1f62
2017-10-24T12:35:22Z
javascript
2017-10-24T16:11:03Z
closed
facebook/react
https://github.com/facebook/react
11,310
["packages/react-reconciler/README.md"]
Example links in react-reconciler README are broken
Reporting this since it says _"If these links break please file an issue and we’ll fix them. They intentionally link to the latest versions since the API is still evolving."_ and knowing the place of the most up-to-date examples would help me a lot. The issue template does not really fit here but I'm trying to follow it anyway. ------------- **Do you want to request a *feature* or report a *bug*?** Bug (In a README) **What is the current behavior?** In https://github.com/facebook/react/tree/master/packages/react-reconciler there are 3 links to reconciler configuration examples of `react-dom`, `react-art` and `react-native`. All 3 links are broken https://github.com/facebook/react/blob/master/packages/react-native-renderer/src/ReactNativeFiberRenderer.js **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template for React 16: https://jsfiddle.net/Luktwrdm/, template for React 15: https://jsfiddle.net/hmbg7e9w/).** Just visit the [`react-reconciler/README.md`](https://github.com/facebook/react/blob/master/packages/react-reconciler/README.md) **What is the expected behavior?** Correct links I wanted to fix these in a PR but could only find an appropriate replacement for react-native here: https://github.com/facebook/react/blob/master/packages/react-native-renderer/src/ReactNativeFiberRenderer.js **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** Issue exists on `master`-branch
https://github.com/facebook/react/issues/11310
https://github.com/facebook/react/pull/11312
97776fb6d211f3bcc363787d29c2824234e524f7
69fcc81ce4896ac0f0790a3bb4a7a842c349e447
2017-10-21T12:54:51Z
javascript
2017-10-21T14:13:54Z
closed
facebook/react
https://github.com/facebook/react
11,278
["scripts/release/build-commands/update-package-versions.js"]
React Test Renderer's Peer dependency keeps getting bumped
I noticed that react-test-renderer's peer dependency for React gets bumped with every version update (or at least that's what happens in version 15. v16 is still 16.0.0). Is this required? Could the peer dependency for version 16 not stay at ^16.0.0 even after the versions of each package get bumped to say 16.1? I ask because this makes it hard for libraries to pull in react-test-renderer so that their end users (who do not use it directly) don't have to pull in a package they never use directly. The specific example I have in mind is enzyme. For version 15, it has a peer dependency on `react@^15.5.0`, and a dependency on `react-test-renderer@^15.5.0`. if I have react 15.5 installed and enzyme tries to install the latest react-test-renderer, then it will pull in 15.6.2, which requires `react@^15.6.2`, which 15.5 does not satisfy. Until recently, they made the test renderer a peer dependency, which was very annoying as a user of the library because you should not have to manually install a package that you don't use directly. We changed that to be a regular dependency, but are now noticing that the peer dependency the test-renderer has on react gets bumped every version change, which causes the above problem. Is it not possible to leave the peer dependency within the major version? At least for v16 going forward? Or is there another way a library can pull in the test renderer without forcing the user to do it?
https://github.com/facebook/react/issues/11278
https://github.com/facebook/react/pull/11292
845b1afdc5ee82dd33751270fbde3cb8def4070a
fa5adb3bc44fae7ee97ad089f3e290be7153ed07
2017-10-19T04:08:49Z
javascript
2017-10-20T15:53:15Z
closed
facebook/react
https://github.com/facebook/react
11,254
["fixtures/art/VectorWidget.js", "packages/react-art/npm/Circle.js", "packages/react-art/npm/Rectangle.js", "packages/react-art/npm/Wedge.js", "packages/react-art/package.json"]
react-art on npm is missing the /lib/ folder
It seems like those were intended to be public APIs (https://github.com/facebook/react/pull/10629) but they’re not published on npm because `lib` folder is not in the `"files"` whitelist.
https://github.com/facebook/react/issues/11254
https://github.com/facebook/react/pull/11343
0ebcbd4f1ed67f6d7ca2ead61f1e63e0700d2c6b
f6c60dcbcd11c756e16b1f0e50c18ca4dc2e3953
2017-10-17T18:22:14Z
javascript
2017-10-23T18:18:11Z
closed
facebook/react
https://github.com/facebook/react
11,236
["packages/react-test-renderer/src/ReactShallowRenderer.js", "packages/react-test-renderer/src/__tests__/ReactShallowRenderer-test.js"]
Shallow test renderer calls shouldComponentUpdate on forceUpdate
There is no extra guard or clause in `enqueueForceUpdate` when calling `render` which means the `render` always calls `shouldComponentUpdate` which can block even forced re-render during tests. This for example [breaks shallow rendering in Enzyme when using MobX and observables](https://github.com/airbnb/enzyme/issues/1267). Minimal test case: ```javascript import React from 'react' import ShallowRenderer from 'react-test-renderer/shallow'; const renderer = new ShallowRenderer(); class TestComponent extends React.Component { render() { return <span/> } } describe('forceUpdate', () => { it('does not call shouldComponentUpdate', () => { let called = 0 TestComponent.prototype.shouldComponentUpdate = () => called += 1 const component = renderer.render(<TestComponent/>); renderer._instance.forceUpdate() expect(called).toBe(0) // <- this throws because called === 1 }) }) ```
https://github.com/facebook/react/issues/11236
https://github.com/facebook/react/pull/11439
c2b68dae640f87335fe224b7903e3448b50def5b
779d23f72e7f2c763f7a3e3373a4134c54356fd6
2017-10-16T15:10:37Z
javascript
2017-11-03T11:03:06Z
closed
facebook/react
https://github.com/facebook/react
11,175
["packages/react-dom/src/server/ReactPartialRenderer.js"]
Flow-ify ReactPartialRenderer.js
It doesn’t have a `@flow` annotation. We should start Flow-ifying it to avoid bugs like https://github.com/facebook/react/pull/11173. @iamdustan Wanna take it?
https://github.com/facebook/react/issues/11175
https://github.com/facebook/react/pull/11251
b0bb1b46aac691766b39d8740472293126f84289
80849fd1c6c7a75d6aa862c53eb2119df706e82d
2017-10-10T15:33:56Z
javascript
2017-10-26T16:59:29Z
closed
facebook/react
https://github.com/facebook/react
11,172
["fixtures/dom/src/components/fixtures/textareas/index.js", "src/renderers/dom/fiber/ReactDOMFiberComponent.js"]
React 16 does not render text area placeholder initially in IE11 Win10
**Bug** **What is the current behavior?** IE11 Windows 10 text area placeholder not rendering initially. [https://jsfiddle.net/fztx6vqp/](https://jsfiddle.net/fztx6vqp/) **What is the expected behavior?** Placeholder should be visible on initial render. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** 16.0.0, IE11, Windows 10 Appears to be a regression in 16.0.0 - #6731
https://github.com/facebook/react/issues/11172
https://github.com/facebook/react/pull/11177
10320a5331d64fe83283d05c64c517402fce3512
309fa6c871362cfa8b2b94a7149585b5f599b73d
2017-10-10T13:34:55Z
javascript
2017-10-10T16:49:59Z
closed
facebook/react
https://github.com/facebook/react
11,152
["src/renderers/dom/shared/eventPlugins/__tests__/EnterLeaveEventPlugin-test.js", "src/renderers/shared/shared/ReactTreeTraversal.js"]
onMouseEnter triggered on children in React 16
Hi, I'm having an issue with `onMouseEnter` being triggered on children of a component. *It only occurs with React 16*. I've created a [CodePen that shows the issue](https://codepen.io/testprofile75/pen/VMXXdb). Simplified structure is as below: ``` <Card/> : ––––––––––––––––––––––––––––– | | | <Cover/> | | | ------------------------------ | | | <div class="text" /> | | | ––––––––––––––––––––––––––––– ``` `<Card />` is a component that needs to capture `onMouseMove` events (and trigger a `render`) and `<Cover/>` is a simple component that waits for an image (passed as a `prop`) to be loaded before displaying it (using `onload` on an `Image` created in the `constructor`). If you open the console, you'll see that `onMouseEnter` is triggered when hovering `<Card />` (normal behavior), but also when hovering the `.text` div (which is not supposed to happen). If you remove the whole `onload` logic from the `<Cover/>` element, then `onMouseEnter` works as intended. It's possible that I'm coding this in a way that isn't appropriate, but it does look like a bug anyway :)
https://github.com/facebook/react/issues/11152
https://github.com/facebook/react/pull/11164
08cbc257bdd75862c88ab1cef6ca2ac410cee8df
80596c2c92dce264f8572038730ce7aef647c5fa
2017-10-09T09:57:11Z
javascript
2017-10-09T19:30:03Z
closed
facebook/react
https://github.com/facebook/react
11,132
["fixtures/dom/src/components/fixtures/input-change-events/RangeKeyboardFixture.js"]
DOM Test Fixtures: Unable to Load React 16
As far as I can tell, the path to the UMD version of React 16 changed, which makes it impossible to test the latest version of React through the test fixtures. We probably need to add a condition to the react loader to change the path above a certain version: https://github.com/facebook/react/blob/master/fixtures/dom/src/react-loader.js#L45-L46
https://github.com/facebook/react/issues/11132
https://github.com/facebook/react/pull/11133
7ec46e0fb0c8a865f0a3c87d563ceb46b05310ef
ea507f163b0b1b32446ed4dd4454580ed6d68f5c
2017-10-06T11:15:15Z
javascript
2017-10-06T14:45:57Z
closed
facebook/react
https://github.com/facebook/react
11,111
["scripts/rollup/bundles.js"]
Consider providing a UMD build for TestUtils again
I noticed we stopped providing it, but a bunch of fiddles for old bugs use it. I wonder if we should add it back, e.g. as `react-dom-test-utils.development.js`. Let’s hear what people have to say.
https://github.com/facebook/react/issues/11111
https://github.com/facebook/react/pull/11599
669a70dab789d58a7c26ec8b4bb897eef37466fa
adcf980333bf7365b0faa6e5510fc7b7362b70bf
2017-10-05T13:53:55Z
javascript
2017-11-20T17:41:01Z
closed
facebook/react
https://github.com/facebook/react
11,103
["src/renderers/dom/fiber/ReactDOMFiberComponent.js", "src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js"]
SSR: ReactDOM client and server handling newlines differently causing mismatch warnings
Bug report: I noticed a "Warning: Text content did not match" warning on certain pages of my isomorphic React app, using React and ReactDOM 16.0.0. After boiling it down to a simple test case it seems that different kinds of newlines are handled differently, some failing to match. If I do: let test = 'foo\nbar'; ... <div>{test}</div> Everything is fine, no mismatch error and the words are separated in the browser. However if I do: let test = 'foo\rbar'; I get: ``` Warning: Text content did not match. Server: "foo bar" Client: "foo bar" ``` Except in the JS error console the second foobar reads as one word. This seems to be a Chrome issue, mishandling single \r carriage return. Try `x = 'a\rb';` and it echoes that string to the console as one word. In the browser I see "foobar" as one word. More importantly though if I do Windows newlines: let x = 'foo\r\nbar'; The result in my app is: ``` Warning: Text content did not match. Server: "foo bar" Client: "foo bar" ``` Which definitely seems like a bug in React's reconciliation logic. Setup: Full list of NPM deps: ``` "dependencies": { "babel-plugin-transform-object-rest-spread": "6.26.0", "babel-preset-es2015": "6.24.1", "babel-preset-react": "6.24.1", "babel-register": "6.26.0", "express": "4.15.3", "json-bigint": "0.2.3", "moment": "2.18.1", "pm2": "2.7.1", "react": "16.0.0", "react-dom": "16.0.0", "request": "2.81.0", "request-promise-native": "1.0.4" }, ``` This is a Node/Express app on Node 8.4.0. Browser is macOS Chrome 61.0.3163.100 Workaround: Preprocess any text that's user-uploaded content to normalize the newlines.
https://github.com/facebook/react/issues/11103
https://github.com/facebook/react/pull/11119
32ec797274ae2b956bab45aa335be50026ce1209
44c32fc26891867f2a35fb3c9bbedbedd148ccbb
2017-10-05T00:58:59Z
javascript
2017-10-05T19:59:43Z
closed
facebook/react
https://github.com/facebook/react
11,036
["www/gatsby-node.js", "www/src/layouts/index.js"]
Warning Documentation 404 Not Found
**Do you want to request a *feature* or report a *bug*?** Bug **What is the current behavior?** The documentation for [warnings](https://github.com/facebook/react/tree/master/docs/warnings) returns a 404 **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/ebsrpraL/).** https://cl.ly/080p0f1t400y **What is the expected behavior?** Redirect to correct documentation. ~~**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**~~ --- The workaround is to look at the cached version from a google search or check for markdown [here](https://github.com/facebook/react/tree/master/docs/warnings).
https://github.com/facebook/react/issues/11036
https://github.com/facebook/react/pull/11038
4c8d248757cb18b9251411e0c3a2d29e951386d5
bbb272f3aae322bf2b13db862356d78957bafac7
2017-10-02T18:50:18Z
javascript
2017-10-02T19:12:32Z
closed
facebook/react
https://github.com/facebook/react
11,023
["src/renderers/dom/fiber/ReactDOMFiberComponent.js"]
[Feature request] Disable the "unrecognized tag" warning in React 16 but only for specific tags.
**Do you want to request a *feature* or report a *bug*?** *Feature* **What is the current behavior?** In Firefox the `dialog` element is not implemented. We use a polyfill to be able to support it. Everything works well. But React warns that the `dialog` element is unrecognized, and this on each page load, which is quite useless (for this specific case). I would like the possibility to disable the warning but only for some elements. So the utility of this warning remains when the developer mistype the component name. **What is the expected behavior?** Once we specified which tag are "accepted/normal" React will not warn on specified unrecognized tags. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React 16 Firefox 57 In previous versions there was no warning. Is this clear enough? Do you need any other information? Cheers
https://github.com/facebook/react/issues/11023
https://github.com/facebook/react/pull/11035
9d4c2dfaac682c546bc746ed257b408b4e862f3d
223396ad0a63680a77b928712b34914ebc1e2788
2017-10-02T10:03:13Z
javascript
2017-10-02T17:59:37Z
closed
facebook/react
https://github.com/facebook/react
11,019
["packages/react-dom/src/__tests__/ReactTestUtils-test.js", "packages/react-dom/src/test-utils/ReactTestUtils.js"]
Deprecate and remove TestUtils.mockComponent
It is a Jest-ism that shouldn't be in our open source package. People using Jest can implement a similar pattern directly.
https://github.com/facebook/react/issues/11019
https://github.com/facebook/react/pull/13193
afd46490d0b384ddf3f67f9a8fc857e32cdecfe3
d64d1ddb570a4fb7d748f4c500ac083886c2f0ec
2017-10-02T00:06:18Z
javascript
2018-07-11T17:18:49Z
closed
facebook/react
https://github.com/facebook/react
11,018
["scripts/prettier/index.js", "www/static/js/jsfiddle-integration-babel.js", "www/static/js/jsfiddle-integration.js"]
Old fiddles are broken after the new domain/website
http://fb.me/react-js-fiddle-integration.js no longer works, and this causes all old fiddles like http://jsfiddle.net/haa2euy9/1/ to break. We should fix it.
https://github.com/facebook/react/issues/11018
https://github.com/facebook/react/pull/11030
641ade94bd2887ad30186e856ade750a5f5f2d21
2fdb84d999d4041b2a0fd890121d949c1a672772
2017-10-01T23:49:11Z
javascript
2017-10-02T15:48:59Z
closed
facebook/react
https://github.com/facebook/react
11,017
["fixtures/dom/src/components/Header.js", "fixtures/dom/src/components/fixtures/custom-elements/index.js", "fixtures/dom/src/components/fixtures/index.js", "src/__mocks__/vendor/third_party/WebComponents.js", "src/renderers/dom/fiber/ReactDOMFiberEntry.js", "src/renderers/dom/shared/__tests__/ReactMount-test.js"]
Fiber cannot render to DocumentFragment/ShadowRoot
**Do you want to request a *feature* or report a *bug*?** bug **What is the current behavior?** React 15.x was able to render within a DocumentFragment/shadowRoot, not possible with Fiber anymore **DEMO** https://www.webpackbin.com/bins/-KvPFG7-HGfQ34IgUxQt ```js import React, {Component} from 'react' import {render} from 'react-dom' class MyComponent extends Component{ render(){ return <div>Hello From React !</div> } } class MyElement extends HTMLElement { static is = 'my-element' constructor(){ super() const shadowRoot = this.attachShadow({mode:'open'}) try { // this fails render(<MyComponent/>, shadowRoot) } catch (e){ console.error(e) shadowRoot.innerHTML = ` <div style="color:red;">${e}</div> <div>see console log for stack trace</div> ` } } connectedCallback(){ console.log('MyElement mounted!') } } customElements.define(MyElement.is, MyElement) ``` related -> https://github.com/skatejs/renderer-react/issues/3 **What is the expected behavior?** be able to render to shadow root like previous versions of React **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React 16 Chrome
https://github.com/facebook/react/issues/11017
https://github.com/facebook/react/pull/11037
bbb272f3aae322bf2b13db862356d78957bafac7
8b4ec79d4f4fea7fcea06ed58ec5329fbc64bafe
2017-10-01T23:33:20Z
javascript
2017-10-02T19:50:14Z
closed
facebook/react
https://github.com/facebook/react
11,010
["fixtures/dom/src/components/fixtures/selects/index.js", "src/renderers/dom/fiber/wrappers/ReactDOMFiberSelect.js"]
Reset of select ignores defaultValue
**Do you want to request a *feature* or report a *bug*?** I report a bug. **What is the current behavior?** When resetting a form which contains a select with a defaultValue, the selected option becomes the first option element in the list, not the one with value=defaultValue. **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/ebsrpraL/).** I have put a piece of code here : https://codepen.io/zehiro/pen/YrxZWw?editors=1111#0 Click on the reset button, which just does a form.reset() on the form. **What is the expected behavior?** I expect the select to select the option with value=defaultValue (like applying a form.reset() on a `<input/>` **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** React-DOM 15.6.2. It seems to be browser independent (tried with Chromium 61 and firefox 55 for Fedora). I didn't try this on prior version of React.
https://github.com/facebook/react/issues/11010
https://github.com/facebook/react/pull/11057
b2101cb3281bff54af8527d6b3b7d78371395e37
5c6cb597f9a4e6eef4d1461b2af234498e52ac7f
2017-10-01T14:57:47Z
javascript
2017-10-10T15:54:59Z
closed
facebook/react
https://github.com/facebook/react
10,993
["fixtures/ssr/src/components/Chrome.js", "src/renderers/dom/fiber/ReactDOMFiberComponent.js"]
React 16 fails to rehydrate noscripts
**Do you want to request a *feature* or report a *bug*?** Bug. **What is the current behavior?** As of React 16, `<noscript dangerouslySetInnerHTML={...} />`s are not properly rehydrated. Equivalent code works in React 15. **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/ebsrpraL/).** Consider the following server-side code: ```js const React = require('react'); const ReactDOMServer = require('react-dom/server'); class Main extends React.Component { render() { const component = React.createElement('strong', {}, 'Hello!'); const contents = ReactDOMServer.renderToStaticMarkup(component); console.log("--- Contents: " + contents); return React.createElement('noscript', { dangerouslySetInnerHTML: {__html: contents}, }, null); } } function createApp() { return React.createElement(Main, {}, null); } console.log(ReactDOMServer.renderToString(createApp())); ``` This code works fine in Reacts 15 and 16 alike; the outputs are similar: ``` // React 15 --- Contents: <strong>Hello!</strong> <noscript data-reactroot="" data-reactid="1" data-react-checksum="1795300394"><strong>Hello!</strong></noscript> // React 16 --- Contents: <strong>Hello!</strong> <noscript data-reactroot=""><strong>Hello!</strong></noscript> ``` Now, consider the following application ([jsbin](https://jsbin.com/xonayepave/edit?html,output)): ```html <!DOCTYPE html> <html> <body> <!-- React 16 (exhibits bug) --> <script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script> <script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script> <!-- React 15 (does not exhibit bug) --> <!-- <script crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react.js"></script> <script crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/react/15.6.1/react-dom.js"></script> --> <div id="target"><noscript data-reactroot=""><strong>Hello!</strong></noscript></div> <script> class Main extends React.Component { render() { const contents = '<strong>Hello!</strong>'; console.log("--- Contents: " + contents); return React.createElement('noscript', { dangerouslySetInnerHTML: {__html: contents}, }, null); } } function createApp() { return React.createElement(Main, {}, null); } (ReactDOM.hydrate || ReactDOM.render)( createApp(), document.getElementById('target')); console.log("Initialized."); </script> </body> </html> ``` In React 16, this displays the following in the console: ``` [log] --- Contents: <strong>Hello!</strong> [err] Warning: Prop `dangerouslySetInnerHTML` did not match. Server: "&lt;strong&gt;Hello!&lt;/strong&gt;" Client: "<strong>Hello!</strong>" [log] Initialized. ``` If you swap the comment blocks in the HTML so that React 15 is used, the code works just fine: there are no warnings. (This is true regardless of whether you change the contents of `div#target` from the React 16 output to the React 15 output.) The error message confuses me; it states that the server output is ``` &lt;strong&gt;Hello!&lt;/strong&gt; ``` but this is not consistent with the output of the server-side code (neither the "Contents" nor the final markup emitted has HTML entities). Please note that this is important because it breaks [the only known workaround][workaround] to #1252. [workaround]: https://github.com/facebook/react/issues/1252#issuecomment-246161590 I believe that this may be specific to `noscript`s, because if one replaces all occurrences of `noscript` with `div` then the example works fine in React 16. **What is the expected behavior?** Rendering a component with `renderToString` and then rehydrating that component verbatim should not yield an error. **Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?** Regression from 15 to 16. Tested in Chrome v61.
https://github.com/facebook/react/issues/10993
https://github.com/facebook/react/pull/11157
f42dfcdb943eb2c5299139820f626e8a81561165
e5db5302ac76e688ca044177d199435272c3ade1
2017-09-30T18:25:41Z
javascript
2017-10-10T18:35:43Z
closed
facebook/react
https://github.com/facebook/react
10,987
["fixtures/attribute-behavior/AttributeTableSnapshot.md", "src/renderers/dom/shared/HTMLDOMPropertyConfig.js", "src/renderers/dom/shared/__tests__/ReactDOMServerIntegration-test.js"]
<svg tabIndex="2"> doesn't work
See the original report in https://github.com/facebook/react/issues/10772#issuecomment-333242375. The problem is that SVG is case sensitive, and so naïvely setting `tabIndex` and relying on insensitivity won't work with it. The good news is it seems like `tabindex` is the only valid [SVG attribute](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute) with this problem. We just missed it because it applies both to HTML and SVG. I think the fix is to add it back to the whitelist.
https://github.com/facebook/react/issues/10987
https://github.com/facebook/react/pull/11033
fbdd43fd70119c56ef06268a525168ebbb30e1f5
fbd6b9ded6f7c40bfde62c4881b364f54e73a026
2017-09-30T10:24:07Z
javascript
2017-10-02T17:52:26Z
closed
facebook/react
https://github.com/facebook/react
10,976
["www/src/components/CodeEditor/CodeEditor.js"]
React.org enable tab out of Live JSX Editor
The current React.org default behavior is that keyboard users will get to the code sections of the live editor and get stuck. Can someone configure ignoreTabKey which makes the editor ignore tab key presses so that keyboard users can tab past the editor without getting stuck? Chrome on Windows atm and cannot edit it to submit a fix. Sorry about that :(
https://github.com/facebook/react/issues/10976
https://github.com/facebook/react/pull/10992
25dbf03e66efa7bd3fe854df677e3c69bb45d5e2
53c1b8b0d7109748d95592ea4fdc50e490d9565c
2017-09-29T20:26:43Z
javascript
2017-10-03T18:15:00Z
closed
facebook/react
https://github.com/facebook/react
10,965
["www/src/css/algolia.css"]
[website] docsearch improvements
**What is the current behavior?** the docsearch on the new page changed its design, but two features are different than in the previous version: - the "cursor" no longer has a separate colour (visible when you use the arrow keys to select a result) - there no longer is an Algolia logo / mention **What is the expected behavior?** - A slightly different background colour for the cursor - A mention of "search by Algolia" or our logo, as which is required because it's a free plan. Happy to open a PR for both of those issues, with whatever colour / solution we choose cc @bvaughn and @gaearon
https://github.com/facebook/react/issues/10965
https://github.com/facebook/react/pull/11032
f6a79d1f1607fb5e50904b143edcf3801144d2ce
e367a4478913ca5bf52fa2260897718f7d16035b
2017-09-29T16:36:29Z
javascript
2017-10-03T17:39:14Z
closed
facebook/react
https://github.com/facebook/react
10,925
["www/src/prism-styles.js"]
[website] highlighted lines in code snippets don't have enough contrast
**Do you want to request a *feature* or report a *bug*?** This is an accessibility issue with the new documentation website. It's a clear-cut problem, but the solution is pretty open ended and ill defined. Might be difficult, and could use some design creativity. **What is the current behavior?** We are using [Prism.js](http://prismjs.com/) for the syntax highlighting styles of our code snippets. We also sometimes want to "highlight" a certain line, so we lighten the background of that line. With the lighter background, many of the font colors don't provide enough contrast. **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/ebsrpraL/).** You can verify this by [running the aXe a11y audit](https://www.deque.com/products/axe/) on this page: https://reactjs.org/docs/introducing-jsx.html **What is the expected behavior?** We need a way to highlight a line without losing so much contrast. BUT choosing a different hue without making it lighter looks bad in my opinion, and I would rather not fiddle with the various font colors used in the syntax highlighting. We should either collaborate with the Prism project to add a 'highlight' option with enough contrast, or find another library/system to use for syntax highlighting.
https://github.com/facebook/react/issues/10925
https://github.com/facebook/react/pull/10931
b43574067e3bf9bfbf9fd772bd82a010b8c88dda
7ae5ed0e7b087a202a8cfa24d7b4b5cde7c913e1
2017-09-28T17:51:32Z
javascript
2017-09-30T14:54:20Z