import React from 'react'; import Resizer, { IResizerProps } from './Resizer'; import { Meta, Story } from '@storybook/react'; export default { title: 'Utility/Resizer', component: Resizer, parameters: { docs: { description: { component: Resizer.peek.description, }, }, }, } as Meta; /* Basic */ export const Basic: Story = (args) => { return ( {(width, height) => (
Width: {width}
Height: {height}
)}
); }; /* With Flex */ export const WithFlex: Story = (args) => { return (
Other content
{(width) => (
When using Resizer within a flexed container, its critical to add{' '} flexGrow: 1, overflow: 'hidden' to its styles so it will behave correctly.
Width: {width}
Height: {width * 0.3}
)}
); };