@@ -23,15 +23,15 @@ Using [npm](https://www.npmjs.com/):
2323
2424### Usage
2525
26- ``` javascript
27- var Resizable = require (' react-resizable' ).Resizable ; // or,
28- var ResizableBox = require (' react-resizable' ).ResizableBox ;
26+ ``` js
27+ const Resizable = require (' react-resizable' ).Resizable ; // or,
28+ const ResizableBox = require (' react-resizable' ).ResizableBox ;
2929
30- // Using ES6 transpiler
30+ // ES6
3131import { Resizable , ResizableBox } from ' react-resizable' ;
3232
33- ...
34- render : function () {
33+ // ...
34+ render () {
3535 return (
3636 < ResizableBox width= {200 } height= {200 } draggableOpts= {{... }}
3737 minConstraints= {[100 , 100 ]} maxConstraints= {[300 , 300 ]}>
@@ -41,41 +41,24 @@ render: function() {
4141}
4242```
4343
44- ### ` <Resizable> ` Options
45-
46- ``` js
47- {
48- // Functions
49- onResizeStop: React .PropTypes .func ,
50- onResizeStart: React .PropTypes .func ,
51- onResize: React .PropTypes .func ,
52-
53- width: React .PropTypes .number .isRequired ,
54- height: React .PropTypes .number .isRequired ,
55- // If you change this, be sure to update your css
56- handleSize: React .PropTypes .array ,
57- // These will be passed wholesale to react-draggable
58- draggableOpts: React .PropTypes .object
59- }
60- ```
44+ ### Props
6145
62- ### ` <ResizableBox >` Options
46+ These props apply to both ` <Resizable >` and ` <ResizableBox> ` .
6347
6448``` js
6549{
66- // Preserves aspect ratio (default: false)
67- lockAspectRatio: React .PropTypes .bool ,
68-
69- // Restricts resizing to a particular axis (default: 'both')
70- axis: React .PropTypes .oneOf ([' both' , ' x' , ' y' , ' none' ]),
71-
72- // Constaints coords, pass [x,y]
73- minConstraints: React .PropTypes .arrayOf (React .PropTypes .number ),
74- maxConstraints: React .PropTypes .arrayOf (React .PropTypes .number ),
75-
76- // Initial width/height - otherwise use CSS
77- height: React .PropTypes .number ,
78- width: React .PropTypes .number
79- }
80- ```
50+ children: React .Element < any> ,
51+ width: number,
52+ height: number,
53+ // If you change this, be sure to update your css
54+ handleSize: [number, number] = [10 , 10 ],
55+ lockAspectRatio: boolean = false ,
56+ axis: ' both' | ' x' | ' y' | ' none' = ' both' ,
57+ minConstraints: [number, number] = [10 , 10 ],
58+ maxConstraints: [number, number] = [Infinity , Infinity ],
59+ onResizeStop?: ? (e : SyntheticEvent , data : ResizeCallbackData ) => any,
60+ onResizeStart?: ? (e : SyntheticEvent , data : ResizeCallbackData ) => any,
61+ onResize?: ? (e : SyntheticEvent , data : ResizeCallbackData ) => any,
62+ draggableOpts?: ? Object
63+ };
8164` ` `
0 commit comments