diff --git a/.size-limit.js b/.size-limit.js index 9f4e7638edb07c..0e27eb31ae496f 100644 --- a/.size-limit.js +++ b/.size-limit.js @@ -28,7 +28,7 @@ module.exports = [ name: 'The size of the @material-ui/core modules', webpack: true, path: 'packages/material-ui/build/index.js', - limit: '92.4 KB', + limit: '91.9 KB', }, { name: 'The theme object', @@ -40,7 +40,7 @@ module.exports = [ name: 'The size of the @material-ui/styles modules', webpack: true, path: 'packages/material-ui-styles/build/index.js', - limit: '16.4 KB', + limit: '16.3 KB', }, { name: 'The size of the @material-ui/system modules', @@ -87,7 +87,7 @@ module.exports = [ name: 'The main docs bundle', webpack: false, path: main.path, - limit: '194 KB', + limit: '193 KB', }, { name: 'The docs home page', diff --git a/docs/src/pages/demos/menus/RenderPropsMenu.js b/docs/src/pages/demos/menus/RenderPropsMenu.js deleted file mode 100644 index 95c949e506a341..00000000000000 --- a/docs/src/pages/demos/menus/RenderPropsMenu.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import Button from '@material-ui/core/Button'; -import Menu from '@material-ui/core/Menu'; -import MenuItem from '@material-ui/core/MenuItem'; -import toRenderProps from 'recompose/toRenderProps'; -import withState from 'recompose/withState'; - -const WithState = toRenderProps(withState('anchorEl', 'updateAnchorEl', null)); - -function RenderPropsMenu() { - return ( - - {({ anchorEl, updateAnchorEl }) => { - const open = Boolean(anchorEl); - const handleClose = () => { - updateAnchorEl(null); - }; - - return ( - - - - Profile - My account - Logout - - - ); - }} - - ); -} - -export default RenderPropsMenu; diff --git a/docs/src/pages/demos/menus/menus.md b/docs/src/pages/demos/menus/menus.md index e5b987593af1c7..a6493326bf8135 100644 --- a/docs/src/pages/demos/menus/menus.md +++ b/docs/src/pages/demos/menus/menus.md @@ -55,13 +55,6 @@ If the height of a menu prevents all menu items from being displayed, the menu c {{"demo": "pages/demos/menus/LongMenu.js"}} -## Render Props - -It is a [render props](https://reactjs.org/docs/render-props.html) demo that -keeps track of the local state for a single menu. - -{{"demo": "pages/demos/menus/RenderPropsMenu.js"}} - ## Limitations There is [a flexbox bug](https://bugs.chromium.org/p/chromium/issues/detail?id=327437) that prevents `text-overflow: ellipsis` from working in a flexbox layout. diff --git a/docs/src/pages/layout/breakpoints/RenderPropsWithWidth.js b/docs/src/pages/layout/breakpoints/RenderPropsWithWidth.js deleted file mode 100644 index d624c449c63773..00000000000000 --- a/docs/src/pages/layout/breakpoints/RenderPropsWithWidth.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import withWidth from '@material-ui/core/withWidth'; -import Typography from '@material-ui/core/Typography'; -import toRenderProps from 'recompose/toRenderProps'; - -const WithWidth = toRenderProps(withWidth()); - -function RenderPropsWithWidth() { - return ( - - {({ width }) => Current width: {width}} - - ); -} - -export default RenderPropsWithWidth; diff --git a/docs/src/pages/layout/breakpoints/breakpoints.md b/docs/src/pages/layout/breakpoints/breakpoints.md index 5637e5128cd3f4..bfb3f6cec3613f 100644 --- a/docs/src/pages/layout/breakpoints/breakpoints.md +++ b/docs/src/pages/layout/breakpoints/breakpoints.md @@ -78,28 +78,6 @@ In the following demo, we change the rendered DOM element (*em*, u, ~~del {{"demo": "pages/layout/breakpoints/WithWidth.js"}} -#### Render Props - -In some cases, you can experience property name collisions using higher-order components. -To avoid this, you can use the [render props](https://reactjs.org/docs/render-props.html) pattern shown in the following demo. - -```jsx -import Typography from '@material-ui/core/Typography'; -import toRenderProps from 'recompose/toRenderProps'; - -const WithWidth = toRenderProps(withWidth()); - -export default function MyComponent() { - return ( - - {({ width }) =>
{`Current width: ${width}`}
} -
- ); -} -``` - -{{"demo": "pages/layout/breakpoints/RenderPropsWithWidth.js"}} - ## API ### `theme.breakpoints.up(key) => media query` diff --git a/docs/src/pages/premium-themes/onepirate/modules/views/AppFooter.js b/docs/src/pages/premium-themes/onepirate/modules/views/AppFooter.js index 0616de52b0b8f2..382a6541aa25a7 100644 --- a/docs/src/pages/premium-themes/onepirate/modules/views/AppFooter.js +++ b/docs/src/pages/premium-themes/onepirate/modules/views/AppFooter.js @@ -1,6 +1,5 @@ import React from 'react'; import PropTypes from 'prop-types'; -import pure from 'recompose/pure'; import { withStyles } from '@material-ui/core/styles'; import Grid from '@material-ui/core/Grid'; import Link from '@material-ui/core/Link'; @@ -152,6 +151,6 @@ AppFooter.propTypes = { }; export default compose( - pure, + React.memo, withStyles(styles), )(AppFooter); diff --git a/docs/src/pages/utils/popover/RenderPropsPopover.js b/docs/src/pages/utils/popover/RenderPropsPopover.js deleted file mode 100644 index 305484cd6446b2..00000000000000 --- a/docs/src/pages/utils/popover/RenderPropsPopover.js +++ /dev/null @@ -1,66 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { withStyles } from '@material-ui/core/styles'; -import Typography from '@material-ui/core/Typography'; -import Button from '@material-ui/core/Button'; -import Popover from '@material-ui/core/Popover'; -import toRenderProps from 'recompose/toRenderProps'; -import withState from 'recompose/withState'; - -const WithState = toRenderProps(withState('anchorEl', 'updateAnchorEl', null)); - -const styles = theme => ({ - typography: { - margin: theme.spacing(2), - }, -}); - -function RenderPropsPopover(props) { - const { classes } = props; - - return ( - - {({ anchorEl, updateAnchorEl }) => { - const open = Boolean(anchorEl); - return ( - - - { - updateAnchorEl(null); - }} - anchorOrigin={{ - vertical: 'bottom', - horizontal: 'center', - }} - transformOrigin={{ - vertical: 'top', - horizontal: 'center', - }} - > - The content of the Popover. - - - ); - }} - - ); -} - -RenderPropsPopover.propTypes = { - classes: PropTypes.object.isRequired, -}; - -export default withStyles(styles)(RenderPropsPopover); diff --git a/docs/src/pages/utils/popover/SimplePopover.hooks.js b/docs/src/pages/utils/popover/SimplePopover.hooks.js new file mode 100644 index 00000000000000..63c68fa5384b42 --- /dev/null +++ b/docs/src/pages/utils/popover/SimplePopover.hooks.js @@ -0,0 +1,53 @@ +import React from 'react'; +import { makeStyles } from '@material-ui/styles'; +import Popover from '@material-ui/core/Popover'; +import Typography from '@material-ui/core/Typography'; +import Button from '@material-ui/core/Button'; + +const useStyles = makeStyles(theme => ({ + typography: { + padding: theme.spacing(2), + }, +})); + +function SimplePopover() { + const classes = useStyles(); + const [anchorEl, setAnchorEl] = React.useState(null); + + function handleClick(event) { + setAnchorEl(event.currentTarget); + } + + function handleClose() { + setAnchorEl(null); + } + + const open = Boolean(anchorEl); + const id = open ? 'simple-popover' : null; + + return ( +
+ + + The content of the Popover. + +
+ ); +} + +export default SimplePopover; diff --git a/docs/src/pages/utils/popover/SimplePopover.js b/docs/src/pages/utils/popover/SimplePopover.js index e05089bc6437e7..9bb6fbba2cd531 100644 --- a/docs/src/pages/utils/popover/SimplePopover.js +++ b/docs/src/pages/utils/popover/SimplePopover.js @@ -36,7 +36,7 @@ class SimplePopover extends React.Component { return (
- - {({ TransitionProps }) => ( - - - - The content of the Popper. - - - - )} - - - ); - }} - - ); -} - -RenderPropsPopper.propTypes = { - classes: PropTypes.object.isRequired, -}; - -export default withStyles(styles)(RenderPropsPopper); diff --git a/docs/src/pages/utils/popper/popper.md b/docs/src/pages/utils/popper/popper.md index 6ef87e6e1f882c..3e54b0f7b77aab 100644 --- a/docs/src/pages/utils/popper/popper.md +++ b/docs/src/pages/utils/popper/popper.md @@ -49,13 +49,6 @@ Highlight part of the text to see the popper: {{"demo": "pages/utils/popper/FakedReferencePopper.js"}} -## Render Props - -It is a [render props](https://reactjs.org/docs/render-props.html) demo that -keeps track of the local state for a single popper. - -{{"demo": "pages/utils/popper/RenderPropsPopper.js"}} - ## Complementary projects For more advanced use cases you might be able to take advantage of: diff --git a/packages/material-ui-icons/package.json b/packages/material-ui-icons/package.json index c657bec4856444..1de127383e9e23 100644 --- a/packages/material-ui-icons/package.json +++ b/packages/material-ui-icons/package.json @@ -41,8 +41,7 @@ "react-dom": "^16.8.0" }, "dependencies": { - "@babel/runtime": "^7.2.0", - "recompose": "0.28.0 - 0.30.0" + "@babel/runtime": "^7.2.0" }, "devDependencies": { "fs-extra": "^7.0.0", diff --git a/packages/material-ui-icons/src/utils/createSvgIcon.js b/packages/material-ui-icons/src/utils/createSvgIcon.js index afbcddaa6d228c..e910c85c64c6a9 100644 --- a/packages/material-ui-icons/src/utils/createSvgIcon.js +++ b/packages/material-ui-icons/src/utils/createSvgIcon.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '@material-ui/core/SvgIcon'; function createSvgIcon(path, displayName) { @@ -10,7 +9,7 @@ function createSvgIcon(path, displayName) { ); Icon.displayName = `${displayName}Icon`; - Icon = pure(Icon); + Icon = React.memo(Icon); Icon.muiName = 'SvgIcon'; return Icon; diff --git a/packages/material-ui-lab/src/SpeedDialIcon/SpeedDialIcon.test.js b/packages/material-ui-lab/src/SpeedDialIcon/SpeedDialIcon.test.js index 3f525be071cc79..29fd7387092c07 100644 --- a/packages/material-ui-lab/src/SpeedDialIcon/SpeedDialIcon.test.js +++ b/packages/material-ui-lab/src/SpeedDialIcon/SpeedDialIcon.test.js @@ -3,6 +3,7 @@ import { assert } from 'chai'; import { createMount, createShallow, getClasses } from '@material-ui/core/test-utils'; import Icon from '@material-ui/core/Icon'; import SpeedDialIcon from './SpeedDialIcon'; +import AddIcon from '../internal/svg-icons/Add'; describe('', () => { let shallow; @@ -22,8 +23,7 @@ describe('', () => { it('should render the Add icon by default', () => { const wrapper = shallow(); - const buttonWrapper = wrapper.childAt(0); - assert.strictEqual(buttonWrapper.find('pure(Add)').length, 1); + assert.strictEqual(wrapper.find(AddIcon).length, 1); }); it('should render an Icon', () => { diff --git a/packages/material-ui-lab/src/internal/svg-icons/Add.js b/packages/material-ui-lab/src/internal/svg-icons/Add.js index 7e68619f0dbd9a..621810d3d3c749 100644 --- a/packages/material-ui-lab/src/internal/svg-icons/Add.js +++ b/packages/material-ui-lab/src/internal/svg-icons/Add.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '@material-ui/core/SvgIcon'; /** @@ -11,7 +10,7 @@ let Add = props => ( ); -Add = pure(Add); +Add = React.memo(Add); Add.muiName = 'SvgIcon'; export default Add; diff --git a/packages/material-ui/package.json b/packages/material-ui/package.json index fca54b8f18c901..23ee7d3db0027b 100644 --- a/packages/material-ui/package.json +++ b/packages/material-ui/package.json @@ -61,7 +61,6 @@ "prop-types": "^15.6.0", "react-event-listener": "^0.6.2", "react-transition-group": "^2.2.1", - "recompose": "0.28.0 - 0.30.0", "warning": "^4.0.1" }, "sideEffects": false, diff --git a/packages/material-ui/src/Avatar/Avatar.test.js b/packages/material-ui/src/Avatar/Avatar.test.js index e5437c5bb2e42d..8bc00d9866b51f 100644 --- a/packages/material-ui/src/Avatar/Avatar.test.js +++ b/packages/material-ui/src/Avatar/Avatar.test.js @@ -90,7 +90,7 @@ describe('', () => { it('should render a div containing an svg icon', () => { assert.strictEqual(wrapper.name(), 'div'); - assert.strictEqual(wrapper.childAt(0).name(), 'pure(Cancel)'); + assert.strictEqual(wrapper.childAt(0).type(), CancelIcon); }); it('should merge user classes & spread custom props to the root node', () => { diff --git a/packages/material-ui/src/Chip/Chip.test.js b/packages/material-ui/src/Chip/Chip.test.js index 3b1facd59bd03c..1fa68d160ace34 100644 --- a/packages/material-ui/src/Chip/Chip.test.js +++ b/packages/material-ui/src/Chip/Chip.test.js @@ -168,7 +168,7 @@ describe('', () => { assert.strictEqual(wrapper.name(), 'div'); assert.strictEqual(wrapper.childAt(0).type(), Avatar); assert.strictEqual(wrapper.childAt(1).name(), 'span'); - assert.strictEqual(wrapper.childAt(2).name(), 'pure(Cancel)'); + assert.strictEqual(wrapper.childAt(2).type(), CancelIcon); }); it('should merge user classes & spread custom props to the root node', () => { @@ -191,7 +191,7 @@ describe('', () => { const onDeleteSpy = spy(); wrapper.setProps({ onDelete: onDeleteSpy }); - wrapper.find('pure(Cancel)').simulate('click', { stopPropagation: () => {} }); + wrapper.find(CancelIcon).simulate('click', { stopPropagation: () => {} }); assert.strictEqual(onDeleteSpy.callCount, 1); }); @@ -200,7 +200,7 @@ describe('', () => { const stopPropagationSpy = spy(); wrapper.setProps({ onDelete: onDeleteSpy }); - wrapper.find('pure(Cancel)').simulate('click', { stopPropagation: stopPropagationSpy }); + wrapper.find(CancelIcon).simulate('click', { stopPropagation: stopPropagationSpy }); assert.strictEqual(stopPropagationSpy.callCount, 1); }); diff --git a/packages/material-ui/src/internal/svg-icons/ArrowDownward.js b/packages/material-ui/src/internal/svg-icons/ArrowDownward.js index 0c814e7a1f8fb2..c3e726ec3d5b29 100644 --- a/packages/material-ui/src/internal/svg-icons/ArrowDownward.js +++ b/packages/material-ui/src/internal/svg-icons/ArrowDownward.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -11,7 +10,7 @@ let ArrowDownward = props => ( ); -ArrowDownward = pure(ArrowDownward); +ArrowDownward = React.memo(ArrowDownward); ArrowDownward.muiName = 'SvgIcon'; export default ArrowDownward; diff --git a/packages/material-ui/src/internal/svg-icons/ArrowDropDown.js b/packages/material-ui/src/internal/svg-icons/ArrowDropDown.js index 96c36ec49ca958..0b22abaefddbe3 100644 --- a/packages/material-ui/src/internal/svg-icons/ArrowDropDown.js +++ b/packages/material-ui/src/internal/svg-icons/ArrowDropDown.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -11,7 +10,7 @@ let ArrowDropDown = props => ( ); -ArrowDropDown = pure(ArrowDropDown); +ArrowDropDown = React.memo(ArrowDropDown); ArrowDropDown.muiName = 'SvgIcon'; export default ArrowDropDown; diff --git a/packages/material-ui/src/internal/svg-icons/Cancel.js b/packages/material-ui/src/internal/svg-icons/Cancel.js index 56276feb9e6ffe..d4f28edba706b3 100644 --- a/packages/material-ui/src/internal/svg-icons/Cancel.js +++ b/packages/material-ui/src/internal/svg-icons/Cancel.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -10,7 +9,7 @@ let Cancel = props => ( ); -Cancel = pure(Cancel); +Cancel = React.memo(Cancel); Cancel.muiName = 'SvgIcon'; export default Cancel; diff --git a/packages/material-ui/src/internal/svg-icons/CheckBox.js b/packages/material-ui/src/internal/svg-icons/CheckBox.js index a9fc07635f581a..65c839e7a3e1ca 100644 --- a/packages/material-ui/src/internal/svg-icons/CheckBox.js +++ b/packages/material-ui/src/internal/svg-icons/CheckBox.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -10,7 +9,7 @@ let CheckBox = props => ( ); -CheckBox = pure(CheckBox); +CheckBox = React.memo(CheckBox); CheckBox.muiName = 'SvgIcon'; export default CheckBox; diff --git a/packages/material-ui/src/internal/svg-icons/CheckBoxOutlineBlank.js b/packages/material-ui/src/internal/svg-icons/CheckBoxOutlineBlank.js index c3eededd487901..776174279e51f9 100644 --- a/packages/material-ui/src/internal/svg-icons/CheckBoxOutlineBlank.js +++ b/packages/material-ui/src/internal/svg-icons/CheckBoxOutlineBlank.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -10,7 +9,7 @@ let CheckBoxOutlineBlank = props => ( ); -CheckBoxOutlineBlank = pure(CheckBoxOutlineBlank); +CheckBoxOutlineBlank = React.memo(CheckBoxOutlineBlank); CheckBoxOutlineBlank.muiName = 'SvgIcon'; export default CheckBoxOutlineBlank; diff --git a/packages/material-ui/src/internal/svg-icons/CheckCircle.js b/packages/material-ui/src/internal/svg-icons/CheckCircle.js index ac2a1a62a8ac74..95097cd413ac80 100644 --- a/packages/material-ui/src/internal/svg-icons/CheckCircle.js +++ b/packages/material-ui/src/internal/svg-icons/CheckCircle.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -10,7 +9,7 @@ let CheckCircle = props => ( ); -CheckCircle = pure(CheckCircle); +CheckCircle = React.memo(CheckCircle); CheckCircle.muiName = 'SvgIcon'; export default CheckCircle; diff --git a/packages/material-ui/src/internal/svg-icons/IndeterminateCheckBox.js b/packages/material-ui/src/internal/svg-icons/IndeterminateCheckBox.js index 79952cce08146c..4d0d66dfc959aa 100644 --- a/packages/material-ui/src/internal/svg-icons/IndeterminateCheckBox.js +++ b/packages/material-ui/src/internal/svg-icons/IndeterminateCheckBox.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -10,7 +9,7 @@ let IndeterminateCheckBox = props => ( ); -IndeterminateCheckBox = pure(IndeterminateCheckBox); +IndeterminateCheckBox = React.memo(IndeterminateCheckBox); IndeterminateCheckBox.muiName = 'SvgIcon'; export default IndeterminateCheckBox; diff --git a/packages/material-ui/src/internal/svg-icons/KeyboardArrowLeft.js b/packages/material-ui/src/internal/svg-icons/KeyboardArrowLeft.js index c85a14b11ac6cb..d322f3f005bd04 100644 --- a/packages/material-ui/src/internal/svg-icons/KeyboardArrowLeft.js +++ b/packages/material-ui/src/internal/svg-icons/KeyboardArrowLeft.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -10,7 +9,7 @@ let KeyboardArrowLeft = props => ( ); -KeyboardArrowLeft = pure(KeyboardArrowLeft); +KeyboardArrowLeft = React.memo(KeyboardArrowLeft); KeyboardArrowLeft.muiName = 'SvgIcon'; export default KeyboardArrowLeft; diff --git a/packages/material-ui/src/internal/svg-icons/KeyboardArrowRight.js b/packages/material-ui/src/internal/svg-icons/KeyboardArrowRight.js index a513fc5e3ad92b..347b7851504b58 100644 --- a/packages/material-ui/src/internal/svg-icons/KeyboardArrowRight.js +++ b/packages/material-ui/src/internal/svg-icons/KeyboardArrowRight.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -10,7 +9,7 @@ let KeyboardArrowRight = props => ( ); -KeyboardArrowRight = pure(KeyboardArrowRight); +KeyboardArrowRight = React.memo(KeyboardArrowRight); KeyboardArrowRight.muiName = 'SvgIcon'; export default KeyboardArrowRight; diff --git a/packages/material-ui/src/internal/svg-icons/MoreHoriz.js b/packages/material-ui/src/internal/svg-icons/MoreHoriz.js index be082e72a2e621..07e3ded7a4fafd 100644 --- a/packages/material-ui/src/internal/svg-icons/MoreHoriz.js +++ b/packages/material-ui/src/internal/svg-icons/MoreHoriz.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -10,7 +9,7 @@ let MoreHoriz = props => ( ); -MoreHoriz = pure(MoreHoriz); +MoreHoriz = React.memo(MoreHoriz); MoreHoriz.muiName = 'SvgIcon'; export default MoreHoriz; diff --git a/packages/material-ui/src/internal/svg-icons/RadioButtonChecked.js b/packages/material-ui/src/internal/svg-icons/RadioButtonChecked.js index e5043e136bc9a2..397b8f5823297f 100644 --- a/packages/material-ui/src/internal/svg-icons/RadioButtonChecked.js +++ b/packages/material-ui/src/internal/svg-icons/RadioButtonChecked.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -10,7 +9,7 @@ let RadioButtonChecked = props => ( ); -RadioButtonChecked = pure(RadioButtonChecked); +RadioButtonChecked = React.memo(RadioButtonChecked); RadioButtonChecked.muiName = 'SvgIcon'; export default RadioButtonChecked; diff --git a/packages/material-ui/src/internal/svg-icons/RadioButtonUnchecked.js b/packages/material-ui/src/internal/svg-icons/RadioButtonUnchecked.js index 985a23724147dc..1730021920221b 100644 --- a/packages/material-ui/src/internal/svg-icons/RadioButtonUnchecked.js +++ b/packages/material-ui/src/internal/svg-icons/RadioButtonUnchecked.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -10,7 +9,7 @@ let RadioButtonUnchecked = props => ( ); -RadioButtonUnchecked = pure(RadioButtonUnchecked); +RadioButtonUnchecked = React.memo(RadioButtonUnchecked); RadioButtonUnchecked.muiName = 'SvgIcon'; export default RadioButtonUnchecked; diff --git a/packages/material-ui/src/internal/svg-icons/Warning.js b/packages/material-ui/src/internal/svg-icons/Warning.js index 3664c9c706352c..63d488ad654db4 100644 --- a/packages/material-ui/src/internal/svg-icons/Warning.js +++ b/packages/material-ui/src/internal/svg-icons/Warning.js @@ -1,5 +1,4 @@ import React from 'react'; -import pure from 'recompose/pure'; import SvgIcon from '../../SvgIcon'; /** @@ -10,7 +9,7 @@ let Warning = props => ( ); -Warning = pure(Warning); +Warning = React.memo(Warning); Warning.muiName = 'SvgIcon'; export default Warning; diff --git a/test/utils/init.js b/test/utils/init.js index d29cde44e3f9df..947d5d2bcac74c 100644 --- a/test/utils/init.js +++ b/test/utils/init.js @@ -1,6 +1,10 @@ import enzyme from 'enzyme/build/index'; import Adapter from 'enzyme-adapter-react-16'; import consoleError from './consoleError'; +import React from 'react'; + +// Waiting for https://github.com/airbnb/enzyme/issues/1875 +React.memo = x => x consoleError(); diff --git a/yarn.lock b/yarn.lock index 3b59e2fbe1db5b..dea619da38102a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4188,11 +4188,6 @@ chalk@~0.4.0: has-color "~0.1.0" strip-ansi "~0.1.0" -change-emitter@^0.1.2: - version "0.1.6" - resolved "https://registry.yarnpkg.com/change-emitter/-/change-emitter-0.1.6.tgz#e8b2fe3d7f1ab7d69a32199aff91ea6931409515" - integrity sha1-6LL+PX8at9aaMhma/5HqaTFAlRU= - chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" @@ -6158,7 +6153,7 @@ eslint-plugin-jsx-a11y@^6.0.3: jsx-ast-utils "^2.0.1" "eslint-plugin-material-ui@file:packages/eslint-plugin-material-ui": - version "3.0.0" + version "4.0.0" eslint-plugin-mocha@^5.0.0: version "5.2.1" @@ -6579,7 +6574,7 @@ fastparse@^1.1.1: resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.2.tgz#91728c5a5942eced8531283c79441ee4122c35a9" integrity sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ== -fbjs@^0.8.1, fbjs@^0.8.4, fbjs@^0.8.9: +fbjs@^0.8.4, fbjs@^0.8.9: version "0.8.17" resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd" integrity sha1-xNWY6taUkRJlPWWIsBpc3Nn5D90= @@ -11659,7 +11654,7 @@ react-jss@^8.6.1: prop-types "^15.6.0" theming "^1.3.0" -react-lifecycles-compat@^3.0.2, react-lifecycles-compat@^3.0.4: +react-lifecycles-compat@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== @@ -12030,18 +12025,6 @@ recharts@^1.1.0: recharts-scale "^0.4.2" reduce-css-calc "~1.3.0" -"recompose@0.28.0 - 0.30.0": - version "0.30.0" - resolved "https://registry.yarnpkg.com/recompose/-/recompose-0.30.0.tgz#82773641b3927e8c7d24a0d87d65aeeba18aabd0" - integrity sha512-ZTrzzUDa9AqUIhRk4KmVFihH0rapdCSMFXjhHbNrjAWxBuUD/guYlyysMnuHjlZC/KRiOKRtB4jf96yYSkKE8w== - dependencies: - "@babel/runtime" "^7.0.0" - change-emitter "^0.1.2" - fbjs "^0.8.1" - hoist-non-react-statics "^2.3.1" - react-lifecycles-compat "^3.0.2" - symbol-observable "^1.0.4" - recursive-copy@2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/recursive-copy/-/recursive-copy-2.0.6.tgz#d590f9eb5f165b96a1b80bc8f9cbcb5c6f9c89e9" @@ -13471,7 +13454,7 @@ svgo@^1.0.0, svgo@^1.0.5: unquote "~1.1.1" util.promisify "~1.0.0" -symbol-observable@1.2.0, symbol-observable@^1.0.4, symbol-observable@^1.1.0, symbol-observable@^1.2.0: +symbol-observable@1.2.0, symbol-observable@^1.1.0, symbol-observable@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==