IAppComponentContext
runtime / IAppComponentContext
Interface: IAppComponentContext
app component getInitialProps params context
Hierarchy
↳
IAppComponentContext
Table of contents
Properties
Methods
Properties
appContext
• appContext: IApplicationCreaterContext
Application context object, which accompanies the entire application life cycle IApplicationCreaterClientContext for client IApplicationCreaterServerContext for server
Inherited from
IRouteComponentContext.appContext
error
• error: IErrorHandler
throw error if necessary
error(502, 'custom error describe')
Inherited from
isServer
• isServer: boolean
is running on server, if server is true, client will be false
Inherited from
IRouteComponentContext.isServer
params
• params: IParams
the params of current url
eg. url /x?name=xx path /:lng
{lng:x}
Inherited from
pathname
• pathname: string
current url path
Inherited from
IRouteComponentContext.pathname
query
• query: IQuery
the query string of current url
eg. url /x?name=xx
{name:xx}
Inherited from
redirect
• redirect: IRedirectFn
redirect function
redirect('/target')
redirect(301, '/target')
Inherited from
IRouteComponentContext.redirect
Methods
fetchInitialProps
▸ fetchInitialProps(): Promise
<void
>
Returns
Promise
<void
>