-
Notifications
You must be signed in to change notification settings - Fork 12
Add support for GB 9.2 / WP 5.6 with useBlockProps #200
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
Conversation
src/index.js
Outdated
| }; | ||
|
|
||
| // GB 9.2, WP 5.6 | ||
| const blockProps = useBlockProps && useBlockProps(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting an ESLint failure here:
ESLint: React Hook "useBlockProps" is called in function "edit" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter.(react-hooks/rules-of-hooks)
|
Blocked by WordPress/gutenberg#26301. |
3e37976 to
e546113
Compare
|
Thanks for the collaboration 👍 I tested out this PR and it worked fine on WP 5.5 with and without the GB 9.2.1 plugin, also tested on WP 5.6 and it worked fine. I did see an error when testing in 5.3, it looks like it is in the escapeRichText function, the lodash flow looks like it wants a function and you're passing in the content string, not sure why I only saw the error in 5.3 and not the others, seems like it should be the opposite 🤷♂️ Here is a screen grab, run in WP 5.3, add block, save and reload editor: |
|
Oh, well it's trying to import Still, I thought that importing a non-existent function would result in |
|
|
@westonruter Latest change works for me both in WP 5.3 and WP 5.6 👍 |


See mkaz/code-syntax-block#88
Props @mkaz
Fixes #188
Fixes #201