cssinjs / cssinjs/jss

Bug with react-jss compilation: "Warning: [JSS] Rule is not linked. Missing sheet option "link: true"."

Open
#1,639 0 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.1k
Forks
386
PR merge metrics
No merged PRs in 30d

Description

__Expected behavior:__
I expect when I add the `link:true` option to `createUseStyles` from `jss-react` the following warning should not show up in my terminal: Warning: [JSS] Rule is not linked. Missing sheet option "link: true".

__Describe the bug:__
I've been setting up css using the `createUseStyles` function from `react-jss`. I get the following error: Warning: [JSS] Rule is not linked. Missing sheet option "link: true".

I read up on the docs a little and I found you can add the link option as an optional behaviour to your `createUseStyles` function. Sadly, this does not resolve the issue.

I checked the types of the `createUseStyles` function, it does indeed extend off the "StyleSheetFactoryOptions" type with the `link?: boolean` added.

__Versions (please complete the following information):__
- react-jss: 10.0.0
- Browser [e.g. chrome, safari]: N/A
- OS [e.g. Windows, macOS]: MacOS
- React: 18.2.0
- Node: 18.10.0

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the warning with react-jss 10.0.0, React 18.2.0, and the createUseStyles entry point using link: true. Trace how that option is passed to JSS and add a regression test showing the warning is absent when linked styles are used. Done means the reported setup no longer emits the warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.