react / react/react-strict-dom

styleq: <cssAtom> typeof undefined is not "string" or "null".

Open
#452 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
3.6k
Forks
206
PR merge metrics
No merged PRs in 30d

Description

Describe the issue

I recently updated from RSD 0.33 to 0.55 and started encountering this error.

Returning undefined for a property in an inline style function now causes this error. I believe these values were previously ignored / stripped by RSD.

Expected behavior

If this is an intentional change, I would expect the typescript types for this function to disallow undefined values.

Steps to reproduce
const styles = css.create({
  gap: (gap?: number) => ({
    rowGap: gap, // An undefined gap will result in styleq: rowGap-abcdef typeof undefined is not "string" or "null".
  }),
})
Test case

No response

Additional comments

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the example using css.create and an undefined gap value, then trace the inline style handling that produces the styleq error. Check the TypeScript types for inline style functions and existing tests around undefined style values. Done means the reported case has defined behavior and the relevant test or types reflect it.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.