Skip to content

Commit f01d16f

Browse files
committed
Avoid importing React
1 parent 6df0af5 commit f01d16f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/diagramElements/Section.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import { Children, cloneElement } from 'react';
22
import clsx from 'clsx';
33
import T from '@wojtekmaj/react-t';
44

@@ -25,8 +25,8 @@ export default function Section(props: SectionProps) {
2525
function renderChildren() {
2626
// If we're creating a section containing subsections, we don't need to create one.
2727
if (children.find((el) => el.type === Subsection)) {
28-
return React.Children.map(children, (child) =>
29-
React.cloneElement(child, Object.assign({ sectionCol: col }, props, child.props)),
28+
return Children.map(children, (child) =>
29+
cloneElement(child, Object.assign({ sectionCol: col }, props, child.props)),
3030
);
3131
}
3232

src/diagramElements/Subsection.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from 'react';
1+
import { Children, cloneElement } from 'react';
22

33
import { methods } from './Section.module.css';
44

@@ -65,8 +65,8 @@ type SubsectionProps = {
6565
};
6666

6767
export default function Subsection({ children, col, colspan, sectionCol }: SubsectionProps) {
68-
const mappedChildren = React.Children.map(children, (child) =>
69-
React.cloneElement(
68+
const mappedChildren = Children.map(children, (child) =>
69+
cloneElement(
7070
child,
7171
Object.assign(
7272
{ col },

0 commit comments

Comments
 (0)