Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default [
},
},
rules: {
'react/prop-types': 2,
'react/prop-types': 0,
'react/jsx-uses-react': 'error',
'react/jsx-uses-vars': 'error',
'prettier/prettier': 'error',
Expand Down
34 changes: 1 addition & 33 deletions src/AutoResizer.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import AutoSizer from 'react-virtualized-auto-sizer';

export interface AutoResizerProps {
className?: string;
width?: number;
height?: number;
children: (size: { width: number; height: number }) => React.ReactNode;
onResize?: (size: { width: number; height: number }) => void;
}
import type { AutoResizerProps } from './types';

/**
* Decorator component that automatically adjusts the width and height of a single child
Expand Down Expand Up @@ -42,29 +35,4 @@ const AutoResizer: React.FC<AutoResizerProps> = ({ className, width, height, chi
);
};

AutoResizer.propTypes = {
/**
* Class name for the component
*/
className: PropTypes.string,
/**
* the width of the component, will be the container's width if not set
*/
width: PropTypes.number,
/**
* the height of the component, will be the container's width if not set
*/
height: PropTypes.number,
/**
* A callback function to render the children component
* The handler is of the shape of `({ width, height }) => node`
*/
children: PropTypes.func.isRequired,
/**
* A callback function when the size of the table container changed if the width and height are not set
* The handler is of the shape of `({ width, height }) => *`
*/
onResize: PropTypes.func,
};

export default AutoResizer;
Loading