* fix: Set VTK viewport as active by interaction * feat: listen for vtkscrollevent in wrapper component * fix: definitions can skip empty storeContexts key * hoc to set/pass in commandsManager * Bump minimum react-vtkjs-viewport version to leverage new event * Simplify to use onScroll event instead of passing down commandsManager to base component * fix: make sure we include @JamesAPetts bug fix Co-authored-by: Danny Brown <danny.ri.brown@gmail.com>
19 lines
446 B
JavaScript
19 lines
446 B
JavaScript
import React from 'react';
|
|
|
|
export default function withCommandsManager(Component, commandsManager = {}) {
|
|
return class WithCommandsManager extends React.Component {
|
|
render() {
|
|
return (
|
|
<Component
|
|
{...this.props}
|
|
onScroll={viewportIndex =>
|
|
commandsManager.runCommand('getVtkApiForViewportIndex', {
|
|
index: viewportIndex,
|
|
})
|
|
}
|
|
/>
|
|
);
|
|
}
|
|
};
|
|
}
|