Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support generating styles without React hooks #171

Open
kylegillen opened this issue May 13, 2022 · 1 comment
Open

Support generating styles without React hooks #171

kylegillen opened this issue May 13, 2022 · 1 comment

Comments

@kylegillen
Copy link

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
Copy link
Owner

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

@vadimdemedes vadimdemedes changed the title How to use in non-hook context? Support generating styles without React hooks Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants