Optimizing the use of islands
An island is a component that is interactive and will be hydrated on the client side. The server sends all the data from the island’spropsfor hydration, and the browser needs time to process and render these islands. Therefore, it is important to take some precautions when using islands:
- Minimize the amount of props to be sent/used for an island
- Make an island only what is necessary, remembering to use
childrenfor internal elements that do not need hydration.
useEffect,
useSignal, etc…). You can view the size of the final JSON through the
Performance tab of one of your site pages in the Deco CMS.

❌ Inappropriate approach
✅ Correct approach
children of the island.
❌ Inappropriate approachIn the example below, we create an island that interacts with
localStorage to
set a title for a gallery of items. In the example below, both the gallery props
will be passed to hydrate the TitleContainer and will also be passed to
hydrate the Gallery.
✅ Correct approachHowever, if the
Gallery is passed as children to the island, it will be
rendered, serialized, and not hydrated! For the TitleContainer, the children
is pre-rendered HTML ready to be displayed, and therefore it is not an island
itself.