question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

createRule in react

See original GitHub issue

Expected behavior: want to use jss.createRule as inline style in react, benefits autoprefixer and other plugins.

Describe the bug: jss.createRule(rule).toJSON() works, however it emits warning in react since the styles are not camelCase.

Codesandbox link: https://codesandbox.io/s/3y3vvnpp6p

Versions (please complete the following information):

  • react-jss: 8.6.1
  • Browser [e.g. chrome, safari]: chrome
  • OS [e.g. Windows, macOS]: macOS Feel free to add any additional versions which you may think are relevant to the bug.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kofcommented, Apr 9, 2019

Yeah, the reason is that the setup of Jss instance you are using is for style tag rendering, so you need a custom setup for inline styles, without came-case plugin. We should document this somewhere.

Also you are a living proof this API is used and we probably shouldn’t remove it in #1076

0reactions
alonronincommented, Apr 11, 2019

yep.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Creating Amazon EventBridge rules that react to events
Open the Amazon EventBridge console at https://console.aws.amazon.com/events/ . In the navigation pane, choose Rules. Choose Create rule. Enter a Name and, ...
Read more >
Create Rule - React on Event of Submitting Contact Form
At first, I was trying to do searching on the core triggers module and how to create my own trigger (which is not...
Read more >
react-use-validator - npm
A React Hook to handle form validation messages. Latest version: 1.0.4, ... import useValidator, { createRule } from "react-use-validator";.
Read more >
9 Ways To Implement CSS in React JS | by Dmitry Nozhenko
Today I want to tell you about css in React app. ... So now I only focus on javascript and react. ... Create...
Read more >
a class name generator function - JSS
Counts how many elements use the same Style Sheet and automatically attach or detach it. It also acts similar to a WeakMap, because...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found