tighten example

This commit is contained in:
Half-Shot
2025-06-05 16:57:48 +01:00
parent 60687b27a6
commit 8cf426f0e7
2 changed files with 5 additions and 3 deletions
@@ -69,8 +69,6 @@ export interface CustomComponentsApi {
// @alpha // @alpha
export type CustomMessageComponentProps = { export type CustomMessageComponentProps = {
mxEvent: MatrixEvent; mxEvent: MatrixEvent;
highlights?: string[];
forExport?: boolean;
}; };
// Warning: (ae-incompatible-release-tags) The symbol "CustomMessageRenderFunction" is marked as @beta, but its signature references "CustomMessageComponentProps" which is marked as @alpha // Warning: (ae-incompatible-release-tags) The symbol "CustomMessageRenderFunction" is marked as @beta, but its signature references "CustomMessageComponentProps" which is marked as @alpha
@@ -70,7 +70,11 @@ export interface CustomComponentsApi {
* return <YourCustomComponent mxEvent={props.mxEvent} />; * return <YourCustomComponent mxEvent={props.mxEvent} />;
* }); * });
* customComponents.registerMessageRenderer(/m\.room\.(topic|name)/, (props, originalComponent) => { * customComponents.registerMessageRenderer(/m\.room\.(topic|name)/, (props, originalComponent) => {
* return <YourCustomStateRenderer mxEvent={props.mxEvent} />; * if (props.mxEvent.isState()) {
* return <YourCustomStateRenderer mxEvent={props.mxEvent} />;
* }
* // Passthrough.
* return null;
* }); * });
* ``` * ```
*/ */