0
0
Fork 0

Use the new JSX transform (#25064)

This commit is contained in:
Renaud Chaput 2023-05-23 10:52:27 +02:00 committed by GitHub
parent e387175fc9
commit 8f66126b10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
241 changed files with 366 additions and 473 deletions

View file

@ -1,4 +1,4 @@
import React from 'react';
import { Component, PureComponent, cloneElement, Children } from 'react';
import PropTypes from 'prop-types';
import { Switch, Route } from 'react-router-dom';
import StackTrace from 'stacktrace-js';
@ -7,14 +7,14 @@ import BundleColumnError from '../components/bundle_column_error';
import BundleContainer from '../containers/bundle_container';
// Small wrapper to pass multiColumn to the route components
export class WrappedSwitch extends React.PureComponent {
export class WrappedSwitch extends PureComponent {
render () {
const { multiColumn, children } = this.props;
return (
<Switch>
{React.Children.map(children, child => React.cloneElement(child, { multiColumn }))}
{Children.map(children, child => cloneElement(child, { multiColumn }))}
</Switch>
);
}
@ -29,7 +29,7 @@ WrappedSwitch.propTypes = {
// Small Wrapper to extract the params from the route and pass
// them to the rendered component, together with the content to
// be rendered inside (the children)
export class WrappedRoute extends React.Component {
export class WrappedRoute extends Component {
static propTypes = {
component: PropTypes.func.isRequired,