} */
+ const buttonRef = React.useRef(null);
+ const [enableRipple, setRipple] = React.useState(false);
+
+ React.useEffect(() => {
+ if (buttonRef.current) {
+ buttonRef.current.focusVisible();
+ } else {
+ throw new Error('buttonRef.current must be available');
+ }
+ }, []);
+
+ return (
+
+
+
+ the button
+
+
+ );
+ }
+
+ const { container, getByTestId } = render();
+
+ fireEvent.click(getByTestId('trigger'));
+ expect(container.querySelectorAll('.ripple-pulsate')).to.have.lengthOf(1);
+ });
});
});
diff --git a/packages/material-ui/src/NoSsr/NoSsr.d.ts b/packages/material-ui/src/NoSsr/NoSsr.d.ts
index c35f2d4777cfe4..c6509cd3c1b433 100644
--- a/packages/material-ui/src/NoSsr/NoSsr.d.ts
+++ b/packages/material-ui/src/NoSsr/NoSsr.d.ts
@@ -1,7 +1,7 @@
import * as React from 'react';
export interface NoSsrProps {
- children: React.ReactNode;
+ children?: React.ReactNode;
defer?: boolean;
fallback?: React.ReactNode;
}
diff --git a/packages/material-ui/src/NoSsr/NoSsr.js b/packages/material-ui/src/NoSsr/NoSsr.js
index 1730afca216857..1c9c44fcd148f9 100644
--- a/packages/material-ui/src/NoSsr/NoSsr.js
+++ b/packages/material-ui/src/NoSsr/NoSsr.js
@@ -40,7 +40,7 @@ NoSsr.propTypes = {
/**
* You can wrap a node.
*/
- children: PropTypes.node.isRequired,
+ children: PropTypes.node,
/**
* If `true`, the component will not only prevent server-side rendering.
* It will also defer the rendering of the children into a different screen frame.