Is there a possibility to import the setAttributes() method in a separated module, I mean in what package we can find that method outside the props of edit and save functions
Example: This is a separated component that is gonna be used in the inspector of a specific block:
export default class Color extends Component {
constructor(props) {
super(...arguments);
}
render() {
<div>
<RangeControl
help="Color"
value={color}
onChange={value => setAttributes({color: value})}
min={0}
max={20}
/>
</div>
}
There is a possibility to pass the setAttributes method using the spread opera tor on the component
<Color {...this.props.setAttributes} />
but I want something like:
const { setAttributes } = wp.packageName;
Thanks!