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

Sign in button in Authenticator.SignIn Component clashes with Nativewind 4 #5145

Open
4 tasks done
itomtom opened this issue Apr 11, 2024 · 3 comments
Open
4 tasks done
Labels
Authenticator An issue or a feature-request for an Authenticator UI Component feature-request Request a new feature React Native An issue or a feature-request for React Native platform

Comments

@itomtom
Copy link

itomtom commented Apr 11, 2024

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

React Native

Which UI component?

Authenticator

How is your app built?

Expo Go

What browsers are you seeing the problem on?

iOS (React Native)

Which region are you seeing the problem in?

No response

Please describe your bug.

The Sign In button becomes text white with no background colour when Nativewind v4 is installed.

What's the expected behaviour?

The expected behaviour is for the "Sign in" button to be visible

Help us reproduce the bug!

  • Use the basic example of the authenticator component here.
  • Install Nativewind v4
  • The button will not be visible anymore

Code Snippet

metro.config.js

const { getDefaultConfig } = require('expo/metro-config');
const { withNativeWind } = require('nativewind/metro');

const config = getDefaultConfig(__dirname);

module.exports = withNativeWind(config, { input: './global.css' });

tailwind.config.js

/** @type {import('tailwindcss').Config} */
module.exports = {
    content: ['./**/*.{js,jsx,ts,tsx}'],
    presets: [require('nativewind/preset')],
    theme: {
        screens: {
            xs: '480px',
            sm: '640px',
            md: '768px',
            lg: '1024px',
            xl: '1280px',
            xxl: '1440px',
            xxxl: '1600px',
        },
        fontSize: {
            xs: ['12px', '12px'],
            sm: ['14px', '14px'],
            base: ['16px', '22px'],
            lg: ['18px', '24px'],
            xl: ['20px', '20px'],
            '2xl': ['24px', '28px'],
            '3xl': ['32px', '36px'],
        },
        fontFamily: {
            body: ['ProximaNova-Regular', 'Arial', 'Helvetica', 'sans-serif'],
            heading: ['ProximaNova-Semibold', 'Arial', 'Helvetica', 'sans-serif'],
        },
    },
    plugins: [],
};

global.css

@tailwind base;
@tailwind components;
@tailwind utilities;

babel.config.js

module.exports = function (api) {
  api.cache(true);
  return {
      presets: [['babel-preset-expo', { jsxImportSource: 'nativewind' }], 'nativewind/babel'],
  };
};

Console log output

No response

Additional information and screenshots

There must be conflict in the styling for it to affect the Sign in button.
Another way to potentially address this is to style the button directly however the documentation doesn't provide any example on how to style the Sign In button in React Native.

I also tried to add global css styling but that too did not work.

@github-actions github-actions bot added the pending-triage Issue is pending triage label Apr 11, 2024
@hbuchel
Copy link
Contributor

hbuchel commented Apr 15, 2024

Hi @itomtom I installed the Authenticator + NativeWind@v4 in a fresh Expo app and confirmed I see the same behavior of the button element not being visible. I'm not yet sure of the root cause; given that this is integration with another styling library I will keep this open as a feature request for now.

Additionally and likely unrelated to this issue, I see that you listed Expo Go. Just a note on that if you are using aws-amplify@6 that Expo Go is not supported. Some information on that here.

Screenshot of ios Simulator with Authenticator component screen, the Sign in button is missing

@hbuchel hbuchel added feature-request Request a new feature React Native An issue or a feature-request for React Native platform Authenticator An issue or a feature-request for an Authenticator UI Component and removed pending-triage Issue is pending triage labels Apr 15, 2024
@itomtom
Copy link
Author

itomtom commented Apr 16, 2024

Hi @hbuchel
We're using:

  • "aws-amplify": "^5"
  • "@aws-amplify/ui-react-native": "^1"

So it works with Expo Go. What do you think we can do to resolve this issue and can the classes be namespace to avoid this situation?

@itomtom
Copy link
Author

itomtom commented Apr 27, 2024

Hi @hbuchel
Are there any updates on this? I'm more than happy to override the theme for buttons BUT I attempted with defining containerPrimary and cannot see any reflected changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Authenticator An issue or a feature-request for an Authenticator UI Component feature-request Request a new feature React Native An issue or a feature-request for React Native platform
Projects
None yet
Development

No branches or pull requests

2 participants