dominicarrojado/react-typescript-pagination

Error in PageLink.test.ts

Closed this issue · 4 comments

isrd1 commented

In PageLink.test.ts the line (7 in my code) to render(<PageLink generates an error: "Operator '<' cannot be applied to types 'boolean'...
This is from your code found at: https://dominicarrojado.com/posts/how-to-create-your-own-pagination-in-react-and-typescript-with-tests-part-2/
The code I have is:
describe("<PageLink />", () => { const renderComponent = ({ children, ...props }: Props) => render(<PageLink {...props}>{children}</PageLink>);
and the error is on that last line shown.

Hey @isrd1, thanks for posting your issue here. Hmm, seems like a syntax error. You can check the code here and see if there's a difference. Let me know if error still occurs

isrd1 commented

I did clone your repo before reporting the error, I get exactly the same error with the repo so I'm not sure it can be a typo on my part. I did have an open brace before the render (and one after) but I removed that.

I notice you've marked the issue as closed, did you find the cause of the error and is the repo now updated?

Hey @isrd1 did you try cloning the repo and doing a yarn install --frozen-lockfile or npm clean-install? It might be due to a package version incompatibility.

I only closed the other issue so we can continue in this thread instead.

isrd1 commented

I had cloned the repo afresh but I didn't do a yarn install with the --frozen-lockfile flag. I've done that and, as you suggested the problem has disappeared. Thank you very much.