You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suspense: Generate a suspense phase if your web-component is async and you want to show something while the promise is pending. It also should work during HTML streaming.
exportdefaultasyncfunctionMyWebComponent({},{ state }){constfoo=awaitfetch(/* ... */).then((r)=>r.text());return<div>{foo}</div>;}MyWebComponent.suspense=(props,webContext)=><div>loading...</div>;
Error: generate a error phase if your web-component throws an error and you want to show something without crash the rest of the page.
import{WebContext}from'brisa';exportdefaultfunctionSomeWebComponent(){/* some code */}SomeWebComponent.error=({ error },webContext: WebContext)=>{return<p>Oops! {error.message}</p>;};
The text was updated successfully, but these errors were encountered:
Suspense: Generate a
suspense
phase if your web-component is async and you want to show something while the promise is pending. It also should work during HTML streaming.Error: generate a
error
phase if your web-component throws an error and you want to show something without crash the rest of the page.The text was updated successfully, but these errors were encountered: