Skip to content

Commit

Permalink
fix: align chunk TypeScript type
Browse files Browse the repository at this point in the history
  • Loading branch information
brillout committed Oct 7, 2022
1 parent 0afba57 commit 0ef0c37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/server/renderToStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type Result = (
) & {
streamEnd: Promise<boolean>
disabled: boolean
injectToStream: (chunk: string) => void
injectToStream: (chunk: unknown) => void
}

const globalConfig: { disable: boolean } = ((globalThis as any).__react_streaming = (globalThis as any)
Expand All @@ -52,13 +52,13 @@ function disable() {

async function renderToStream(element: React.ReactNode, options: Options = {}): Promise<Result> {
element = React.createElement(SuspenseData, null, element)
let injectToStream: (chunk: string) => void = (chunk) => buffer.push(chunk)
const buffer: string[] = []
let injectToStream: (chunk: unknown) => void = (chunk) => buffer.push(chunk)
const buffer: unknown[] = []
element = React.createElement(
StreamProvider,
{
value: {
injectToStream: (chunk: string) => {
injectToStream: (chunk: unknown) => {
injectToStream(chunk)
}
}
Expand Down

0 comments on commit 0ef0c37

Please sign in to comment.