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

Box height not working as expected #5727

Open
2 of 5 tasks
kockar96 opened this issue Apr 7, 2023 · 2 comments
Open
2 of 5 tasks

Box height not working as expected #5727

kockar96 opened this issue Apr 7, 2023 · 2 comments

Comments

@kockar96
Copy link

kockar96 commented Apr 7, 2023

Description

When I apply different height values to Box element it behaves in a strange manner

CodeSandbox/Snack link

https://snack.expo.dev/@aki96/787df4

Steps to reproduce

Try doing the same thing as in the video I will attach.
When I assign value to h or height it behaves differently than when same thing is done through styles property.
I might be missing something and this is not a bug. But if is it would be nice to solve it as it currently making me use Dimensions API to assign height to my component.

Screen.Recording.2023-04-07.at.13.18.27.mov

NativeBase Version

^3.4.28

Platform

  • Android
  • CRA
  • Expo
  • iOS
  • Next

Other Platform

No response

Additional Information

No response

@RocTeng
Copy link

RocTeng commented Apr 9, 2023

export const spacing = {
  px: 1,
  1: 4,
  2: 8,
  3: 12,
  ......
  56: 224,
  64: 256,
  72: 288,
  80: 320,
  96: 384,
};

We can use the above tokens in our code instead of using absolute values. ( design-tokens )

You can customize NativeBase's theme as per your liking. ( customizing-theme )

Like this:

<NativeBaseProvider
  theme={extendTheme({
    sizes: {
      "60": 240,
    },
  })}
></NativeBaseProvider>

@kockar96
Copy link
Author

kockar96 commented Apr 9, 2023

Cool, thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants