-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
[core] Add createMuiStrictModeTheme #20523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
0762f98
dbcc5ae
ff01e5c
55afd82
82f323b
f43ffe2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,11 +34,13 @@ const Backdrop = React.forwardRef(function Backdrop(props, ref) { | |
| invisible = false, | ||
| open, | ||
| transitionDuration, | ||
| // eslint-disable-next-line react/prop-types | ||
| TransitionComponent = Fade, | ||
| ...other | ||
| } = props; | ||
|
|
||
| return ( | ||
| <Fade in={open} timeout={transitionDuration} {...other}> | ||
| <TransitionComponent in={open} timeout={transitionDuration} {...other}> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oops, I had forgotten about this one in #17047 (comment). |
||
| <div | ||
| data-mui-test="Backdrop" | ||
| className={clsx( | ||
|
|
@@ -53,7 +55,7 @@ const Backdrop = React.forwardRef(function Backdrop(props, ref) { | |
| > | ||
| {children} | ||
| </div> | ||
| </Fade> | ||
| </TransitionComponent> | ||
| ); | ||
| }); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import * as React from 'react'; | ||
| import { Transition } from '@material-ui/react-transition-group'; | ||
| import { useForkRef } from '../utils'; | ||
| import Collapse from './Collapse'; | ||
|
|
||
| /** | ||
| * @ignore - internal component. | ||
| */ | ||
| const StrictModeCollapse = React.forwardRef(function StrictModeCollapse(props, forwardedRef) { | ||
| const domRef = React.useRef(null); | ||
| const ref = useForkRef(domRef, forwardedRef); | ||
|
|
||
| return ( | ||
| <Collapse | ||
| {...props} | ||
| findDOMNode={() => domRef.current} | ||
| ref={ref} | ||
| TransitionComponent={Transition} | ||
| /> | ||
| ); | ||
| }); | ||
|
|
||
| export default StrictModeCollapse; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| export { default } from './Collapse'; | ||
| export { default, default as unstable_StrictModeCollapse } from './Collapse'; | ||
| export * from './Collapse'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| export { default } from './Collapse'; | ||
| // eslint-disable-next-line camelcase | ||
| export { default as unstable_StrictModeCollapse } from './StrictModeCollapse'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import * as React from 'react'; | ||
| import { Transition } from '@material-ui/react-transition-group'; | ||
| import { useForkRef } from '../utils'; | ||
| import Fade from './Fade'; | ||
|
|
||
| /** | ||
| * @ignore - internal component. | ||
| */ | ||
| const StrictModeFade = React.forwardRef(function StrictModeFade(props, forwardedRef) { | ||
| const domRef = React.useRef(null); | ||
| const ref = useForkRef(domRef, forwardedRef); | ||
|
|
||
| return ( | ||
| <Fade | ||
| {...props} | ||
| findDOMNode={() => domRef.current} | ||
| ref={ref} | ||
| TransitionComponent={Transition} | ||
| /> | ||
| ); | ||
| }); | ||
|
|
||
| export default StrictModeFade; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| export { default } from './Fade'; | ||
| export { default, default as unstable_StrictModeFade } from './Fade'; | ||
| export * from './Fade'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| export { default } from './Fade'; | ||
| // eslint-disable-next-line camelcase | ||
| export { default as unstable_StrictModeFade } from './StrictModeFade'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import * as React from 'react'; | ||
| import { Transition } from '@material-ui/react-transition-group'; | ||
| import { useForkRef } from '../utils'; | ||
| import Grow from './Grow'; | ||
|
|
||
| /** | ||
| * @ignore - internal component. | ||
| */ | ||
| const StrictModeGrow = React.forwardRef(function StrictModeGrow(props, forwardedRef) { | ||
| const domRef = React.useRef(null); | ||
| const ref = useForkRef(domRef, forwardedRef); | ||
|
|
||
| return ( | ||
| <Grow | ||
| {...props} | ||
| findDOMNode={() => domRef.current} | ||
| ref={ref} | ||
| TransitionComponent={Transition} | ||
| /> | ||
| ); | ||
| }); | ||
|
|
||
| export default StrictModeGrow; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| export { default } from './Grow'; | ||
| export { default, default as unstable_StrictModeGrow } from './Grow'; | ||
| export * from './Grow'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| export { default } from './Grow'; | ||
| // eslint-disable-next-line camelcase | ||
| export { default as unstable_StrictModeGrow } from './StrictModeGrow'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import * as React from 'react'; | ||
| import { Transition } from '@material-ui/react-transition-group'; | ||
| import { useForkRef } from '../utils'; | ||
| import Slide from './Slide'; | ||
|
|
||
| /** | ||
| * @ignore - internal component. | ||
| */ | ||
| const StrictModeSlide = React.forwardRef(function StrictModeSlide(props, forwardedRef) { | ||
| const domRef = React.useRef(null); | ||
| const ref = useForkRef(domRef, forwardedRef); | ||
|
|
||
| return ( | ||
| <Slide | ||
| {...props} | ||
| findDOMNode={() => domRef.current} | ||
| ref={ref} | ||
| TransitionComponent={Transition} | ||
| /> | ||
| ); | ||
| }); | ||
|
|
||
| export default StrictModeSlide; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| export { default } from './Slide'; | ||
| export { default, default as unstable_StrictModeSlide } from './Slide'; | ||
| export * from './Slide'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| export { default } from './Slide'; | ||
| // eslint-disable-next-line camelcase | ||
| export { default as unstable_StrictModeSlide } from './StrictModeSlide'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| import * as React from 'react'; | ||
| import { Transition } from '@material-ui/react-transition-group'; | ||
| import { useForkRef } from '../utils'; | ||
| import Zoom from './Zoom'; | ||
|
|
||
| /** | ||
| * @ignore - internal component. | ||
| */ | ||
| const StrictModeZoom = React.forwardRef(function StrictModeZoom(props, forwardedRef) { | ||
| const domRef = React.useRef(null); | ||
| const ref = useForkRef(domRef, forwardedRef); | ||
|
|
||
| return ( | ||
| <Zoom | ||
| {...props} | ||
| findDOMNode={() => domRef.current} | ||
| ref={ref} | ||
| TransitionComponent={Transition} | ||
| /> | ||
| ); | ||
| }); | ||
|
|
||
| export default StrictModeZoom; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,8 @@ const Zoom = React.forwardRef(function Zoom(props, ref) { | |
| onExit, | ||
| style, | ||
| timeout = defaultTimeout, | ||
| // eslint-disable-next-line react/prop-types | ||
| TransitionComponent = Transition, | ||
| ...other | ||
| } = props; | ||
|
|
||
|
|
@@ -74,7 +76,7 @@ const Zoom = React.forwardRef(function Zoom(props, ref) { | |
| }; | ||
|
|
||
| return ( | ||
| <Transition | ||
| <TransitionComponent | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we call the root component prop There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not a fan of the generic term if the component has a specific task. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder. It could feel surprising 🤔. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That the component responsible for Transition is named TransitionComponent over Component? Is this seriously a concern? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be like we change the convention for the style rule, naming the root class name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you think of the idea to introduce a Similarly to what we do for the class names:
we could have:
|
||
| appear | ||
| in={inProp} | ||
| onEnter={handleEnter} | ||
|
|
@@ -95,7 +97,7 @@ const Zoom = React.forwardRef(function Zoom(props, ref) { | |
| ...childProps, | ||
| }); | ||
| }} | ||
| </Transition> | ||
| </TransitionComponent> | ||
| ); | ||
| }); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| export { default } from './Zoom'; | ||
| export { default, default as unstable_StrictModeZoom } from './Zoom'; | ||
| export * from './Zoom'; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,3 @@ | ||
| export { default } from './Zoom'; | ||
| // eslint-disable-next-line camelcase | ||
| export { default as unstable_StrictModeZoom } from './StrictModeZoom'; |
Uh oh!
There was an error while loading. Please reload this page.