Passing Data to Gutenberg


Great work on Sage 10, I’m really enjoying working with it. However, I’m having some trouble with Gutenberg. There’s two main issues I’m having:

  1. I’m using Tailwind, and it only seems to pull certain styles into the block preview. Attached is an example, the first of the front end view and the second of the Gutenberg display. Note the missing styles:

  1. We’re using ACF to create custom Gutenberg blocks - ACF | Blocks

These blocks don’t appear to have access to variables set in the App Composer file. For example, we have a $currentState variable that returns a taxonomy for the current page. Gutenberg throws an error when attempting to load the block in the editor because it doesn’t know the value of $currentState.

Does anybody have solutions to the two issues outlined above? Thanks!

Did you ever come up with a solution to #2? We ran into the same issue and this is one of the only mentions of it I can find. I ended up just creating some dummy data in the blocks and wrapping them is an is_admin() check. There’s gotta be a more elegant way, though. Especially one that actually shows the correct values in the editor.