dillon1000/react
Commit
Browse files Improve hydration fixture, support older versions of React (#14118)
* Hydration Fixture: Only load ReactDOMServer if it exists Fixes an issue where the hydration fixture would try to load in ReactDOMServer below version 14. In version 13, string markup methods exist on the React namespace. * DOM Fixtures: Use class component for App.js This was breaking React 0.13.0. * Hydration Fixture: better findDOMNode compatibility This commit fixes an issue where the Hydration DOM fixture was unusable in React 0.13.0 or lower because of newer API usage. It fixes that by avoiding the use of refs to get the textarea reference in the code editor component, using various versions of findDOMNode as required. * Hydration Fixture: Do not show dropdown for single-line errors If an error showed for the hydration fixture, a detail element was used even if no additional lines could display. In that case, this commit changes the component such that it returns a div. * Deeper React version support for hydration fixture This commit adds support for versions 0.4.0 of React and higher for the hydration fixture. The DOM test fixtures themselves do not support down to React 0.4.0, which would be exhaustive. Instead, the Hydration fixture can pick a version to use for its own purposes. By default, this is the version of React used by the fixtures. In the process of doing this, I had to make some updates to the renderer.html document associated with the hydration fixture, and I've added some comments to better document the history of API changes.
Changed paths9 files
First-parent comparisonfixtures/dom/public/renderer.js ModifiedM fixtures/dom/src/components/App.js ModifiedM fixtures/dom/src/components/Header.js ModifiedA fixtures/dom/src/components/VersionPicker.js AddedM fixtures/dom/src/components/fixtures/hydration/Code.js ModifiedM fixtures/dom/src/components/fixtures/hydration/hydration.css ModifiedM fixtures/dom/src/components/fixtures/hydration/index.js ModifiedA fixtures/dom/src/find-dom-node.js AddedM fixtures/dom/src/react-loader.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…