Fallback canary
How this renderer falls back for a block type it doesn't recognize, and the synthetic block used to test that path.
Slack Block Kit has a fallback convention: when a client doesn’t recognize a block’s type, it can render
that block’s producer-supplied fallback array in its place instead of dropping the content. fallback_canary
is a synthetic block type this library ships to exercise that path in tests and demos. It isn’t a block Slack
itself sends. Point any real, unrecognized block at a fallback array and this renderer handles it the same way.
Fields
typestring
Always `fallback_canary`.
stringfallbackBlock[]
Blocks to render in place of this one. Slack renders the whole list inside the single wrapper it gave the unknown block, which is a flex row, so the fallback blocks sit side by side rather than stacking vertically.
Block[]This isn’t a standard Block Kit block type. It’s a test fixture for the fallback mechanism itself. When this
library encounters a block type it doesn’t have a component for, it looks for a fallback array on that
block and renders those blocks instead of showing nothing.
Examples
Unknown block with a fallback
The example above simulates what happens when your app sends a block type this renderer (or a Slack client)
doesn’t know about yet, but included a fallback for older clients.