Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

270
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda