react-grid-layout / react-resizable

A simple React component that is resizable with a handle.

Home Page:https://strml.github.io/react-resizable/examples/1.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I get the handler direction.

angeloabella9288 opened this issue · comments

I want to get the current handler direction, left or right handle.
I thought the "handle" returns that,

handle={(e) => onResizeHandle(e) }

But after add this code, the app crashes.,

Hope you help me with this.
Thank you!

The handle comes back in the resize callback. The type of the handle prop is a React element or a function returning an element.

See https://github.com/react-grid-layout/react-resizable/blob/master/lib/propTypes.js#L19.

You'd want to do something like:

onResizeStart={(e, data) => doSomethingWith(data.handle)}