How to use the @wordpress/block-editor.withColorContext function in @wordpress/block-editor

To help you get started, we’ve selected a few @wordpress/block-editor examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / wordpress__block-editor / wordpress__block-editor-tests.tsx View on Github external
(() => {
    interface Props extends be.withColorContext.Props {
        foo: string;
    }
    const Component = ({ colors, foo }: Props) => (
        <div>
            <h1>Color list</h1>
            <ul>
                {colors.map((c, i) =&gt; (
                    <li>{c.color}</li>
                ))}
            </ul>
            {foo}
        </div>
    );
    const Enhanced = be.withColorContext(Component);
    ;
    ;
})();