feat(nodes): pass pos to click handler
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { createContext, useState, useEffect, useReducer } from 'react';
|
||||
import React, { createContext, useEffect, useReducer } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import isEqual from 'lodash.isequal';
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ export default NodeComponent => (props) => {
|
||||
className="react-graph__nodewrap"
|
||||
ref={nodeElement}
|
||||
style={{ transform: `translate(${position.x}px,${position.y}px)` }}
|
||||
onClick={() => onNodeClick(data)}
|
||||
onClick={() => onNodeClick({ data, position })}
|
||||
>
|
||||
<NodeComponent {...props} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user