facebook / stylex

StyleX is the styling system for ambitious user interfaces.

Home Page:https://stylexjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support Older React Versions

stevenanthonyrevo opened this issue · comments

Describe the feature request

Can StyleX support older versions of react similar to Style-Components?

React v18 is only supported option.

We already support older versions of React. Since we don't depend on any React features at all, StyleX can be used with any version of React and many other frameworks such Svelte, Solid, Qwik, etc.

As long as you are able to do the bundler setup, there are no restrictions about which component framework, or version you're using.

React v18 is only supported option.

Where did you get this idea? @stylexjs/stylex has no dependency on React at all.

I have a component in React v16.4 and installed via npm
"dependencies": { "@stylexjs/stylex": "^0.5.1", }, "devDependencies": { "@stylexjs/dev-runtime": "^0.5.1", "@stylexjs/webpack-plugin": "^0.5.1" } however I am getting the error Module not found: Error: Can't resolve 'stylex' in and webpack compiled with 1 error

import * as stylex from 'stylex';

const styles = stylex.create({
  red: {color: 'red'},
});
<div {...stylex.props(styles.red)}>Test</div>

The package name is @stylexjs/stylex