nandorojo / moti

🐼 The React Native (+ Web) animation library, powered by Reanimated 3.
https://moti.fyi
MIT License
3.9k stars 120 forks source link

[Question] Web Compat - Would there a possiblity to support className ? #292

Closed Twiggeh closed 1 year ago

Twiggeh commented 1 year ago

Is there a possiblity, that for web support, it would be possible to pass className?

A lot of the css-in-js solutions use className to style components like what moti exports :

E.g.

styled(MotiView)`
css...
nandorojo commented 1 year ago

Moti forwards down all props already. I believe RNW doesn’t support className prior to 0.19.

Twiggeh commented 1 year ago

Hmm maybe I did someting wrong, because

import { motion } from 'framer-motion';
import { MotiView as View } from 'moti';
import styled from '@emotion/styled';
const MyComponent = styled(View)`
    border: 100px solid red;
`;

doesn't work for View, but it does work for motion.div