garronej / tss-react

✨ Dynamic CSS-in-TS solution, based on Emotion

Home Page:https://tss-react.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read properties of undefined (reading 'length') in useGuaranteedMemo

antonmikhaliou opened this issue · comments

Hey, ran into a problem when writing tests where makeStyles is used in a child component. The ref.current.prevDeps.length in the useGuaranteedMemo. If I use ref.current.prevDeps?.length as a check for undefined, everything works fine. Could you please add a check? You would be very helpful. Thanks in advance.

Sure thing!

Great, when will you be able to update?

I'm having trouble understanding how you're encountering this error. I'd greatly appreciate a detailed reproduction path, as there may be an aspect of useRef's functionality that I've overlooked. If this is the case, the TypeScript types of useRef aren't actuate.
Are you working within a Next.js App router project by any chance?
Regardless, I believe the issue should have been resolved in the latest release of tss. Please do inform me if the problem persists.

Best regards,