Skip to content

Instantly share code, notes, and snippets.

@phpbits
Created October 3, 2018 06:38
Show Gist options
  • Select an option

  • Save phpbits/d3bc25feed440947b448d9892a3f6760 to your computer and use it in GitHub Desktop.

Select an option

Save phpbits/d3bc25feed440947b448d9892a3f6760 to your computer and use it in GitHub Desktop.
Access on Edit component using withSelect
edit: withSelect( ( select ) => {
return {
roles: select('phpbits/test-block').receiveUserRoles(),
};
} )( props => {
console.log( this.props.roles );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment