-
Notifications
You must be signed in to change notification settings - Fork 58
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
The books chapter on React uses pre version 18 syntax? #27
Comments
Yes
…On Mon, 9 May, 2022, 07:25 John Williams, ***@***.***> wrote:
I get a bunch of error messages when running the tests on page 259. I
tried to do the following:
import React from "react";
import {App} from "./App.jsx";
import {render} from "react-dom";
import { createRoot } from 'react-dom/client';
import {act} from "react-dom/test-utils"
// @ts-ignore
global.IS_REACT_ACT_ENVIRONMENT = true
const container = document.createElement("div");
let root = createRoot(container)
test('renders the h1 header', () => {
act(()=> {
root.render(<App />);
});
const header = document.querySelector("h1");
expect(header.textContent).toBe("Cheesecakes: ")
});
But I get null passed to the header so the test fails.
If you could point me int he right direction that would be awesome.
—
Reply to this email directly, view it on GitHub
<#27>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAHG7CMWPCVCHFMOBOPEJNLVJBV73ANCNFSM5VMY6SMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
is it possible to get any update on this? |
Hey John, can you provide some more detail about the error you're seeing? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get a bunch of error messages when running the tests on page 259. I tried to do the following:
But I get null passed to the header so the test fails.
If you could point me int he right direction that would be awesome.
The text was updated successfully, but these errors were encountered: