Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do-not-merge: experiment(redwood): Change import of ServerHtmlContext to redwood #91

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@
],
"dependencies": {
"prettier": "^2.8.4"
},
"devDependencies": {
"@redwoodjs/web": "canary"
}
}
4 changes: 2 additions & 2 deletions package/src/ssr/RehydrationContext.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useApolloClient } from "@apollo/client";
import React from "react";
import { NextSSRInMemoryCache } from "./NextSSRInMemoryCache";
import { ServerInsertedHTMLContext } from "next/navigation";
import { ServerHtmlContext } from "@redwoodjs/web";
import { RehydrationContextValue } from "./types";
import { registerDataTransport, transportDataToJS } from "./dataTransport";
import invariant from "ts-invariant";
Expand Down Expand Up @@ -46,7 +46,7 @@ export const RehydrationContextProvider = ({

export function useRehydrationContext(): RehydrationContextValue | undefined {
const rehydrationContext = React.useContext(ApolloRehydrationContext);
const insertHtml = React.useContext(ServerInsertedHTMLContext);
const insertHtml = React.useContext(ServerHtmlContext);

// help transpilers to omit this code in bundling
if (typeof window !== "undefined") return;
Expand Down
3 changes: 2 additions & 1 deletion package/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"declaration": true,
"sourceMap": true,
"jsx": "react",
"declarationMap": true
"declarationMap": true,
"types": ["react/canary"]
}
}
Loading