Skip to content

Commit 61b12cf

Browse files
committed
feat: use jsx-runtime
1 parent 248f18b commit 61b12cf

File tree

38 files changed

+56
-47
lines changed

38 files changed

+56
-47
lines changed

babel.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
module.exports = {
2-
presets: ['@opd/babel-preset-component'],
2+
presets: [
3+
'@opd/babel-preset-component',
4+
require.resolve('@babel/preset-typescript'),
5+
[
6+
require.resolve('@babel/preset-react'),
7+
{
8+
runtime: 'automatic',
9+
},
10+
],
11+
],
312
ignore: ['src/.umi/**/*.ts'],
413
}

src/components/base/index.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import React, {
2-
HTMLAttributes,
1+
import { Plot as BasePlot } from '@antv/g2plot'
2+
import cloneDeep from 'lodash/cloneDeep'
3+
import isEmpty from 'lodash/isEmpty'
4+
import isEqual from 'lodash/isEqual'
5+
import {
36
forwardRef,
4-
useRef,
5-
useEffect,
6-
Ref,
7+
HTMLAttributes,
78
MutableRefObject,
89
ReactElement,
10+
Ref,
911
RefAttributes,
10-
useImperativeHandle,
1112
RefCallback,
13+
useEffect,
14+
useImperativeHandle,
15+
useRef,
1216
} from 'react'
13-
import isEqual from 'lodash/isEqual'
14-
import isEmpty from 'lodash/isEmpty'
15-
import cloneDeep from 'lodash/cloneDeep'
16-
import { Plot as BasePlot } from '@antv/g2plot'
1717

1818
interface Options {
1919
[x: string]: any

src/plots/area/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Area, AreaOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type AreaChartProps = Omit<

src/plots/bar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Bar, BarOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type BarChartProps = Omit<BaseChartProps<BarOptions>, 'chart' | 'data'> &

src/plots/bidirectional-bar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { BidirectionalBar, BidirectionalBarOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type BidirectionalBarChartProps = Omit<

src/plots/box/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Box, BoxOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type BoxChartProps = Omit<BaseChartProps<BoxOptions>, 'chart' | 'data'> &

src/plots/bullet/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Bullet, BulletOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type BulletChartProps = Omit<

src/plots/chord/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Chord, ChordOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type ChordChartProps = Omit<

src/plots/circle-packing/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { CirclePacking, CirclePackingOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type CirclePackingChartProps = Omit<

src/plots/column/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React, { forwardRef } from 'react'
21
import { Column, ColumnOptions } from '@antv/g2plot'
2+
import { forwardRef } from 'react'
33
import BaseChart, { BaseChartProps } from '../../components/base'
44

55
export type ColumnChartProps = Omit<

0 commit comments

Comments
 (0)