Gen2 React SDK: Content overrides break during preview
Describe the bug
The Gen2 React SDK accepts content as a prop but during preview (and in visual editor) implicitly expects that content to be an unmodified response from the Content API. If a user manipulates the content api response before passing to the Content component, for example removing items from blocks or using something like transformComponents from @builder.io/utils, the sdk will refetch fresh content from the API and merge that with the manipulated content, resulting in unexpected behavior.
https://github.com/BuilderIO/builder/blob/main/packages/sdks/src/components/content/components/enable-editor.lite.tsx#L307-L321
To Reproduce Steps to reproduce the behavior:
- Fetch content from Content API
- Modify the content somehow, for example delete a block
content.data.blocks = content.data.blocks.slice(1) - Pass this content to
<Content content={content}> - Preview the page
Expected behavior I expect to be able to manipulate the content fetched from the API as needed for my use case or opt out of the refetching behavior linked above.
Screenshots If applicable, add screenshots to help explain your problem.
Additional context Add any other context about the problem here.