For my use case, we would want the <Message> component to be server-side renderable (SSR). Specifically, we use NextJS (info).
I understand that if you want interactivity for certain blocks (e.g. buttons, inputs, etc), this won't be possible. We aren't targeting interactive blocks at the moment, but the larger majority of the components should be SSR-able. It is okay if react interactivity is isolated to those components, and those components should be marked with 'use client'.
This would require the following to be removed/refactored:
- remove
useEffect in Message:
|
useEffect(() => { |
|
if (data.users) setUsers(data.users); |
|
if (data.channels) setChannels(data.channels); |
|
if (hooks) setHooks(hooks); |
|
}, [data]); |
- use an alternate strategy for the global store:
|
const { setChannels, setUsers, setHooks } = useGlobalData(); |
For my use case, we would want the
<Message>component to be server-side renderable (SSR). Specifically, we use NextJS (info).I understand that if you want interactivity for certain blocks (e.g. buttons, inputs, etc), this won't be possible. We aren't targeting interactive blocks at the moment, but the larger majority of the components should be SSR-able. It is okay if react interactivity is isolated to those components, and those components should be marked with
'use client'.This would require the following to be removed/refactored:
useEffectinMessage:slack-blocks-to-jsx/src/message.tsx
Lines 53 to 57 in 9d462ca
slack-blocks-to-jsx/src/message.tsx
Line 51 in 9d462ca