preactjs / preact-devtools

Browser extension for inspection Preact applications

Home Page:https://preactjs.github.io/preact-devtools/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with JSS useContext

ahoenerBE opened this issue · comments

I'm using Preact with JSS, and I can't seem to inspect one of my components

Screen Shot 2021-08-18 at 6 21 31 PM

VirtualizedItemTable contains JSS styles with the useStyles() hook

const useStyles = createUseStyles({
     innerContainer: {
         display: 'flex',
         flex: '1 1 auto',
         border: '1px solid',
         paddingBottom: '1px'
     },
     table: {},
     header: {
         display: 'flex',
         alignItems: 'center',
         // paddingTop: '.5em',
     },
 });

When attempting to view the component, I get the following on firefox
Screen Shot 2021-08-18 at 6 18 21 PM

and this on Chrome

Screen Shot 2021-08-18 at 6 17 49 PM

Removing the JSS and just using imported CSS works fine

Same error with goober. I made a demo: https://codesandbox.io/s/goober-preact-devtools-tr71r
Works fine if you remove useTheme from setup.

Thank you @ahoenerBE for the report and @AlPacone for the repro case. Just pushed a new version into the review queue and it should be up shortly. The fist was already in main but I missed creating a new version earlier, sorry for the inconvenience!