vadimdemedes / tailwind-rn

🦎 Use Tailwind CSS in React Native projects
MIT License
4.24k stars 171 forks source link

Support generating styles without React hooks #171

Open kylegillen opened 2 years ago

kylegillen commented 2 years ago

Really wanting to use version 4.0.

Pre 4.0, I used the package in the following way with styled components:

File component.style.ts

import styled from 'styled-components/native'
import tw from 'tailwind-rn'

export const styledComponent = styled.View`
  ${tw('bg-blue-500')}
`

I would then import that styled component for use in my component file.

With the new hook based approach in 4.0 this isn't possible it seems.

Is there a non-hook based api available to still achieve this?

vadimdemedes commented 2 years ago

There is no way to have this now. Will leave this issue open, I think it's a valid suggestion.