wix / react-native-ui-lib

UI Components Library for React Native
https://wix.github.io/react-native-ui-lib/
MIT License
6.44k stars 706 forks source link

Default styles not loading unless you manually re-save files again, even for release build #2430

Closed awalmubarak closed 1 year ago

awalmubarak commented 1 year ago

Description

Default styles are not applied even in release build unless I go into each component one by one and save the files again. I thought this was just an issue with debug mode but even when I build release, default styles are not appled

Related to

Steps to reproduce

Add styles to you App.js file , e.g

Spacings.loadSpacings({
  page: 20,
});

Assets.loadAssetsGroup('icons', {
  plus: require('./assets/plus.png'),
});

ThemeManager.setComponentForcedTheme('Text', props => {
  if (Array.isArray(props.style)) {
    return {
      style: [Typography.smallFont, ...props.style],
    };
  }
  return {
    style: [Typography.smallFont, props.style],
  };
});

Run the app.

Expected behavior

App should launch with default styles already applied and release build should also have default styles.

Actual behavior

Default styles won't apply unless you go into the App.js file and save the file to trigger a refresh. And when you build release it doesn't apply default styles too.

More Info

Code snippet

Screenshots/Video

Environment

Affected platforms

awalmubarak commented 1 year ago

Fixed, I had to move the default styles to my index.js file