Facebook Stylex React NativeJavascript

Форум по Javascript
Anonymous
Facebook Stylex React Native

Сообщение Anonymous »

По словам авторов библиотеки https://stylexjs.com/blog/introducing-stylex/ Это должно работать так же, как в Интернете, как в React Native:

Код: Выделить всё

We created StyleX not only to meet the styling needs of React developers on the web, but to unify styling for React across web and native.
Проблема в том, что я не могу заставить его работать в React Native. У меня установлена ​​библиотека, я добавил «@stylexjs/babel-plugin» в массив плагинов в Babel.config.js и в src/comComponents/button у меня есть код
import { Pressable, Text } from "react-native";
import * as stylex from "@stylexjs/stylex";

export const styles = stylex.create({
button: {
backgroundColor: "#00FFFF",
fontSize: 24,
height: 50,
},
text: {
color: "#663399",
},
});

type Props = {
children: string;
};

export const Button = ({ children }: Props) => {
console.log(stylex.props(styles.button));
return (

{children}

);
};
< /code>
образно Помогите здесь. И как, черт возьми, в документации нет ничего в React Native. Это продукт Facebook! : (
i oult не оштрафовал никаких упоминаний о дисках stylex github, может быть, STYLIX не работает в RACET Native ?; P спасибо за любую помощь. < /p>

Подробнее здесь: https://stackoverflow.com/questions/797 ... act-native

Вернуться в «Javascript»