Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make an understandable and working documentation for DimensionControl component #21888

Open
fabienlege opened this issue Apr 25, 2020 · 2 comments
Assignees
Labels
[Type] Developer Documentation Documentation for developers

Comments

@fabienlege
Copy link

I try to implement DimensionControl from official documentation (https://developer.wordpress.org/block-editor/components/dimension-control/) but the exemple provided in doc not working at all.

if you try to run the dox exemple code, you get a sublime partialRight is undefined.

If you try to replace onChange handler by console.log, you get `Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of edit.`

@Soean Soean added the [Type] Developer Documentation Documentation for developers label Apr 25, 2020
@rmorse
Copy link
Contributor

rmorse commented Sep 4, 2020

partialRight is coming from lodash - try including that in your JS

const { partialRight } = window.lodash;

or

import { partialRight } from 'lodash';

@ryanwelcher
Copy link
Contributor

ryanwelcher commented Mar 15, 2023

It looks like the docs need to be updated regardless of this issue so during that process, we can check to see if this error still happens and adjust as needed.

Change first line to import from @wordpress/element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Developer Documentation Documentation for developers
Projects
None yet
Development

No branches or pull requests

5 participants