Skip to main content

internal_.IRouteComponentContext

runtime / <internal> / IRouteComponentContext

Interface: IRouteComponentContext

internal.IRouteComponentContext

route component getInitialProps params context

Table of contents​

Properties​

Properties​

appContext​

• appContext: IApplicationCreaterContext

Application context object, which accompanies the entire application life cycle IApplicationCreaterClientContext for client IApplicationCreaterServerContext for server


error​

• error: IErrorHandler

throw error if necessary

error(502, 'custom error describe')

isServer​

• isServer: boolean

is running on server, if server is true, client will be false


params​

• params: IParams

the params of current url

eg. url /x?name=xx path /:lng

{lng:x}

pathname​

• pathname: string

current url path


query​

• query: IQuery

the query string of current url

eg. url /x?name=xx

{name:xx}

redirect​

• redirect: IRedirectFn

redirect function

redirect('/target')
redirect(301, '/target')