-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Description
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.