Skip to main content

Function: ReactService()

ReactService(paths): (target) => void

Defined in: ReactDecorators.ts:17

Indicates that the decorated class is a React route service.

A path may be a literal ("/pets") or contain :name dynamic-segment tokens ("/pets/:id"), matching a page's own bracketed file (app/pets/[id].tsx). A literal path always wins over a dynamic template for the same request; among dynamic templates, the first one registered wins. The template's own captured values are never used as req.params — those always come from the page file's own bracket capture — so a service's param names don't strictly need to match the page's, though they should by convention for fetchProps to make sense.

Parameters​

paths​

string | string[]

The base path(s) of the app routes to apply the service for.

Returns​

(target) => void