1 |
|
2 |
|
3 |
|
4 | import React, { ReactNode, SVGProps } from 'react';
|
5 | import classNames from 'classnames';
|
6 | import { filterProps } from '../util/types';
|
7 |
|
8 | interface LayerProps {
|
9 | className?: string;
|
10 | children?: ReactNode;
|
11 | }
|
12 |
|
13 | export type Props = SVGProps<SVGGElement> & LayerProps;
|
14 |
|
15 | export function Layer(props: Props) {
|
16 | const { children, className, ...others } = props;
|
17 | const layerClass = classNames('recharts-layer', className);
|
18 |
|
19 | return (
|
20 | <g className={layerClass} {...filterProps(others, true)}>
|
21 | {children}
|
22 | </g>
|
23 | );
|
24 | }
|