Skip to content

Commit

Permalink
Use option for as (#638)
Browse files Browse the repository at this point in the history
* use option for as

* 6.5.1
  • Loading branch information
bokuweb authored Jun 25, 2020
1 parent 8829ee1 commit b87be38
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "re-resizable",
"version": "6.5.0",
"version": "6.5.1",
"description": "Resizable component for React.",
"title": "re-resizable",
"main": "./lib/index.es5.js",
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export type ResizeStartCallback = (
) => void | boolean;

export interface ResizableProps {
as: string | React.ComponentType<any>;
as?: string | React.ComponentType<any>;
style?: React.CSSProperties;
className?: string;
grid?: [number, number];
Expand Down Expand Up @@ -914,7 +914,7 @@ export class Resizable extends React.PureComponent<ResizableProps, State> {
style.flexBasis = this.state.flexBasis;
}

const Wrapper = this.props.as;
const Wrapper = this.props.as ?? 'div';

return (
<Wrapper ref={this.ref} style={style} className={this.props.className} {...extendsProps}>
Expand Down

0 comments on commit b87be38

Please sign in to comment.