forked from topcoder-platform/topcoder-react-utils
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#393] Exports ServerSsrContext type
- Loading branch information
1 parent
87fd790
commit abea9a3
Showing
7 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# ServerSsrContext | ||
[ServerSsrContext]: /docs/api/classes/ServerSsrContext | ||
```tsx | ||
import { ServerSsrContext } from '@dr.pogodin/react-utils'; | ||
``` | ||
|
||
The [ServerSsrContext] class extends | ||
[SsrContext](https://dr.pogodin.studio/docs/react-global-state/docs/api/classes/ssrcontext) | ||
class from the | ||
[React Global State](https://dr.pogodin.studio/docs/react-global-state) | ||
library; it is used by React Utils [server()](/docs/api/functions/server) | ||
factory as a part of SSR setup. | ||
|
||
## Generic Parameters | ||
- `StateT` — The type of global state object. | ||
|
||
## Properties | ||
- `chunkGroups` — **ChunkGroupsT** | ||
- `chunks` — **string[]** — Defaults empty array. | ||
- `req` — **Request** — ExpressJS request being handled. | ||
- `status` — **number** — HTTP status for the response. | ||
Defaults 200 (OK). | ||
|
||
## Methods | ||
|
||
### constructor() | ||
```tsx | ||
constructor(req: Request, chunkGroups: ChunkGroupsT, initialState?: StateT) | ||
``` | ||
Creates a new [ServerSsrContext] instance. | ||
|
||
**Arguments** | ||
- `res` — **Request** | ||
- `chunkGroups` — **ChunkGroupsT** | ||
- `initialState` — **StateT** — Optional. Initial global state value. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters