Skip to content

ServerSideRender missed features #32247

@amir2mi

Description

@amir2mi

Due to some issues and experiments that I have had with <ServerSideRender/>, some features are missed for developing a dynamic block with server-side render.
I know that server-side rendering makes the poor user experience, they should wait for every change. However, for some situations, developers will need to use this component for sure, when there is a complicated PHP file with various conditions that are common for layouts.
As I searched there was a lot of requests about these features around the web:

Callback events: #8379

For some situations, a developer might need to execute a function after the server-side render result.
So these events are expected: onChange and onChangeComplete

<ServerSideRender
        onChange={()=>{
            console.log(0);
        }}
        onChangeComplete={()=>{
            console.log(1);
        }}
/>

Rendering different results based on context: #9510

Server-side render result for front-end and editor might need to be different and this can be possible with context argument for callback function, as said in the mentioned issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions