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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Intellisense in TailwindCSS React Native tailwind() function 馃檹 #132

Closed
tommulkins opened this issue Jun 23, 2020 · 5 comments

Comments

@tommulkins
Copy link

tommulkins commented Jun 23, 2020

How great would it be if we could also have intellisense inside the tailwind() function provided by https://github.com/vadimdemedes/tailwind-rn package?

For example,

<Text style={tailwind('text-center text-white text-2xl')}>
  SIGN UP
</Text>

Any plans to include this too by any chance? 馃槃

@bradlc
Copy link
Contributor

bradlc commented Jun 24, 2020

Hey @tommulkins. I think tailwindlabs/tailwindcss#7553 would cover this

@bradlc bradlc closed this as completed Jun 24, 2020
@jumoel
Copy link

jumoel commented Sep 2, 2020

Until tailwindlabs/tailwindcss#7553 is done, getting intellisense working in React Native with tailwind-rn is possible by tricking the intellisense plugin :) You can write a HOC to allow className props to work with Tailwind in RN:

function withTailwind(Component) {
  function ComponentWithTailwind({ className, style, ...rest }) {
    const classes = className
      ? Array.isArray(className)
        ? className.flat().filter(Boolean).join(" ")
        : className
      : "";

    return <Component style={[tailwind(classes), style && style]} {...rest} />;
  }

  ComponentWithTailwind.displayName = `withTailWind(${getDisplayName(
    Component
  )})`;

  return ComponentWithTailwind;
}

tailwind-intellisense

(More details here: https://www.jumoel.com/posts/tailwind-react-native-classnames)

@realmichaelye
Copy link

+1 for this, please add tailwind-rn support

@harshjadon9
Copy link

+1
please add tailwind-rn support

@oldo
Copy link

oldo commented Mar 17, 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

6 participants