@@ -16,7 +16,7 @@ import {
16
16
ViteDevServer ,
17
17
} from 'vite'
18
18
import { DefaultDocumentTemplate } from './DocumentTemplate'
19
- import { FastifyRendererOptions , FastifyRendererPlugin } from './Plugin'
19
+ import { FastifyRendererOptions , FastifyRendererPlugin , RegisteredRenderable } from './Plugin'
20
20
import { PartialRenderOptions , Render , RenderableRoute , RenderOptions } from './renderers/Renderer'
21
21
import { kRendererPlugin , kRendererViteOptions , kRenderOptions } from './symbols'
22
22
import { wrap } from './tracing'
@@ -71,15 +71,15 @@ const FastifyRenderer = fp<FastifyRendererOptions>(
71
71
72
72
fastify . decorate ( 'registerRenderable' , function ( this : FastifyInstance , renderable : string ) {
73
73
const renderableRoute : RenderableRoute = { ...this [ kRenderOptions ] , renderable }
74
- plugin . registerRoute ( renderableRoute )
74
+ return plugin . registerRoute ( renderableRoute )
75
75
} )
76
76
77
- fastify . decorateReply ( 'render' , async function ( this : FastifyReply , renderable : string , props : any ) {
77
+ fastify . decorateReply ( 'render' , async function ( this : FastifyReply , token : RegisteredRenderable , props : any ) {
78
78
const request = this . request
79
79
const renderableRoute : RenderableRoute = {
80
80
...this . server [ kRenderOptions ] ,
81
81
url : request . url ,
82
- renderable,
82
+ renderable : plugin . registeredComponents [ token ] . renderable ,
83
83
isImperative : true ,
84
84
}
85
85
0 commit comments