Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

271
Views
How to use jss-rtl in react-jss without using material-ui

I'm trying to add jss-rtl to an existing react project like this:

import {
  StrictMode
} from "react";
import ReactDOM from "react-dom";

import App from "./App";

import jss from "jss";
import rtl from "jss-rtl";

// Configure JSS
jss.use(rtl());

const rootElement = document.getElementById("root");
ReactDOM.render( 
  <StrictMode>
    <App/>
  </StrictMode>,
  rootElement
);

so I expect when I create styles using createUseStyles in react-jss, it renders styles in rtl form.

import {
  createUseStyles
} from "react-jss";

export const useStyles = createUseStyles({
  App: {
    marginLeft: 100,
    fontFamily: 'sans-serif'
  }
});

export default function App() {
  const classes = useStyles();
  return ( <div className={classes.App}>
      <h1>  Hello CodeSandbox <h1> 
      <h2> Start editing to see some magic happen! </h2> 
    </div>
  );
}

but as the result that you can see in this sandbox, margin-left: 100px didn't turn into margin-right: 100px and styles are stayed unaffected. I've read many answers but all of them were based on material-ui. I also configured project as jss-rtl documents said, but it didn't mention jss-react. when I configure and write styles exactly as same as documents everything is fine and it flips styles like margin & padding perfectly, but it doesn't work in react (when I use hooks like createUseStyles in react-jss). how can I fix that?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!