diff --git a/packages/react-code-editor/src/components/CodeEditor/CodeEditor.tsx b/packages/react-code-editor/src/components/CodeEditor/CodeEditor.tsx index e6d608779d5..00567f95cca 100644 --- a/packages/react-code-editor/src/components/CodeEditor/CodeEditor.tsx +++ b/packages/react-code-editor/src/components/CodeEditor/CodeEditor.tsx @@ -282,8 +282,7 @@ class CodeEditor extends React.Component { shortcutsPopoverButtonText: 'View Shortcuts', shortcutsPopoverProps: { bodyContent: '', - 'aria-label': 'Keyboard Shortcuts', - ...Popover.defaultProps + 'aria-label': 'Keyboard Shortcuts' }, showEditor: true, options: {}, diff --git a/packages/react-core/src/helpers/util.ts b/packages/react-core/src/helpers/util.ts index a688901585a..7fdd46140af 100644 --- a/packages/react-core/src/helpers/util.ts +++ b/packages/react-core/src/helpers/util.ts @@ -1,4 +1,3 @@ -import * as ReactDOM from 'react-dom'; import { globalWidthBreakpoints, globalHeightBreakpoints, SIDE } from './constants'; /** @@ -180,8 +179,8 @@ export function keyHandler( if (refsCollection[nextIndex].focus) { refsCollection[nextIndex].focus(); } - // eslint-disable-next-line react/no-find-dom-node - const element = ReactDOM.findDOMNode(refsCollection[nextIndex]) as HTMLElement; + + const element = refsCollection[nextIndex] as HTMLElement; element.focus(); } else if (position !== 'tab') { if (isMultiDimensional) { diff --git a/packages/react-docs/static/like-button.js b/packages/react-docs/static/like-button.js deleted file mode 100644 index 2ecc6e3779c..00000000000 --- a/packages/react-docs/static/like-button.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; - -const e = React.createElement; - -class LikeButton extends React.Component { - constructor(props) { - super(props); - this.state = { liked: false }; - } - - render() { - if (this.state.liked) { - return e(PatternFlyReact.Alert, { - title: ' Great success', - children: 'You liked this', - variant: 'success' - }); - } - - return e( - PatternFlyReact.Button, - { onClick: () => this.setState({ liked: true }) }, - 'Like' - ); - } -} - - -const domContainer = document.querySelector('#react-root'); -ReactDOM.render(e(LikeButton), domContainer); \ No newline at end of file diff --git a/packages/react-docs/static/umd.html b/packages/react-docs/static/umd.html deleted file mode 100644 index c72d29669e0..00000000000 --- a/packages/react-docs/static/umd.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - -

PatternFly-React UMD Build

-

- UMD build allow for you to quickly get started using @patternfly/react-core. - If you care about how this is accomplished, it's highly recommended to read  - React's getting started with UMD guide before returning here since. - This guide uses React's guide as a base. -

-

1. Write HTML

-

- Create a container to inject React components into. -

-      <div id="react-root">Inject in here</div>
-    
-

-

2. Include JS

-

- PatternFly React depends on React and PropTypes. Add these to the bottom of the <body> tag on your page: -

-      <script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin="anonymous"></script>
-      <script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin="anonymous"></script>
-      <script src="https://unpkg.com/prop-types@15.6/prop-types.js" crossorigin="anonymous"></script>
-      <script src="https://unpkg.com/@patternfly/react-core@3/dist/umd/react-core.js" crossorigin="anonymous"></script>
-      <script src="like-button.js"></script>
-    
- - @patternfly/react-core exposes a "PatternFlyReact" object for use in your like-button.js. Populate your like-button.js with something like: -
-      'use strict';
-
-      const e = React.createElement;
-
-      class LikeButton extends React.Component {
-        constructor(props) {
-          super(props);
-          this.state = { liked: false };
-        }
-
-        render() {
-          if (this.state.liked) {
-            return e(PatternFlyReact.Alert, {
-              title: ' Great success',
-              children: 'You liked this',
-              variant: 'success'
-            });
-          }
-
-          return e(
-            PatternFlyReact.Button,
-            { onClick: () => this.setState({ liked: true }) },
-            'Like'
-          );
-        }
-      }
-
-
-      const domContainer = document.querySelector('#react-root');
-      ReactDOM.render(e(LikeButton), domContainer);
-    
-

-

3. (Optional) Include styles

-

- You have to include ALL our PatternFly styles. There's two ways to do this: -

-      <link rel="stylesheet" href="https://unpkg.com/@patternfly/patternfly@2/patternfly.css" crossorigin />
-    
- OR -
-      <link rel="stylesheet" href="https://unpkg.com/@patternfly/react-core@3/dist/styles/base.css" crossorigin />
-      <link rel="stylesheet" href="https://unpkg.com/@patternfly/react-core@3/dist/react-core.umd.css" crossorigin />
-    
-

-

4. Don't do this in production

-

- This implementation is very bloated. - ALL of React, ReactDOM, PropTypes (which you don't need in production...), and PatternFly (including CSS and fonts) are included which takes 912KB after being gzipped. - Even when minified, they take 520Kb after being gzipped. - Also, you probably want to be able to use JSX. - To enable using JSX, treeshaking, and other modern JS tools PatternFly recommendeds consumption using Webpack. - It's as simple as cloning our seed repo and running 2 commands! -

-

- This page serves as an example of how to do this. Checkout the like button below! -

-
Inject like button here
- - - - - - - diff --git a/packages/react-table/src/test-helpers/MockedTableChanges.js b/packages/react-table/src/test-helpers/MockedTableChanges.js deleted file mode 100644 index 415acf25ed2..00000000000 --- a/packages/react-table/src/test-helpers/MockedTableChanges.js +++ /dev/null @@ -1,57 +0,0 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; -import { TableContext } from '../components/Table/Table'; -import { TableHeader } from '../components/Table'; - -export const withContext = - ({ context = {}, contextType = {} }) => - (WrappedComponent) => { - class WithContext extends Component { - getChildContext() { - return context; - } - - render() { - return {this.props.children}; - } - } - WithContext.propTypes = { - children: PropTypes.node - }; - WithContext.defaultProps = { - children: null - }; - WithContext.WrappedComponent = WrappedComponent; - WithContext.childContextTypes = contextType; - - return WithContext; - }; - -export const TableProvider = withContext({ - context: { - columns: [], - renderers: { - header: { - wrapper: 'thead', - row: 'tr', - cell: 'th' - } - } - }, - contextType: { columns: PropTypes.any, renderers: PropTypes.any } -})('table'); - -const MockedTableChanges = ({ updateFunc = () => undefined, columns = [] }) => ( - - - - - -); - -MockedTableChanges.propTypes = { - updateFunc: PropTypes.func, - columns: PropTypes.array -}; - -export default MockedTableChanges;