Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

275
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda