UNPKG

554 BTypeScriptView Raw
1/**
2 * @fileOverview Layer
3 */
4import React, { ReactNode, SVGProps } from 'react';
5import classNames from 'classnames';
6import { filterProps } from '../util/types';
7
8interface LayerProps {
9 className?: string;
10 children?: ReactNode;
11}
12
13export type Props = SVGProps<SVGGElement> & LayerProps;
14
15export 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}