Skip to content

Commit

Permalink
chore: simplify types
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Apr 6, 2024
1 parent 33726bc commit a6ca66d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion examples/react-server/src/entry-client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from "react";
import reactDomClient from "react-dom/client";
import { readRscStreamScript } from "./utils/rsc-stream-script";
import { initializeWebpackServer } from "./features/use-client/server";
import type { StreamData } from "./features/stream/utils";
import type { StreamData } from "./entry-react-server";

async function main() {
if (window.location.search.includes("__noCsr")) {
Expand Down
4 changes: 3 additions & 1 deletion examples/react-server/src/entry-react-server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import reactServerDomServer from "react-server-dom-webpack/server.edge";
import Page from "./routes/page";
import { createBundlerConfig } from "./features/use-client/react-server";

export type StreamData = React.ReactNode;

export async function handler({}: { request: Request }) {
const root = <Page />;

const stream = reactServerDomServer.renderToReadableStream(
const stream = reactServerDomServer.renderToReadableStream<StreamData>(
root,
createBundlerConfig(),
);
Expand Down
2 changes: 1 addition & 1 deletion examples/react-server/src/entry-server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
createModuleMap,
initializeWebpackServer,
} from "./features/use-client/server";
import type { StreamData } from "./features/stream/utils";
import type { StreamData } from "./entry-react-server";

export async function handler(request: Request) {
const reactServer = await importReactServer();
Expand Down
1 change: 0 additions & 1 deletion examples/react-server/src/features/stream/utils.ts

This file was deleted.

0 comments on commit a6ca66d

Please sign in to comment.