Add support for GB 9.2 / WP 5.6 with useBlockProps#200
Conversation
src/index.js
Outdated
| }; | ||
|
|
||
| // GB 9.2, WP 5.6 | ||
| const blockProps = useBlockProps && useBlockProps(); |
There was a problem hiding this comment.
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