nirsky / react-native-size-matters

A lightweight, zero-dependencies, React-Native utility belt for scaling the size of your apps UI across different sized devices.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

style value as string error

vladbelozertsev opened this issue · comments

When i try to set style value as string (example: padding: '25@ms'), i get errors (screenshots below). I add some changes in index.d.ts file and now it works for me (no errors). Can i make pull request?

Errors:

  1. Type '"25@ms"' is not assignable to type 'DimensionValue | undefined'.ts(2322)
  2. Types of property 'fontSize' are incompatible. Type 'string | number | undefined' is not assignable to type 'number | undefined'.
  3. Types of property 'overflow' are incompatible. Type '"visible" | "hidden" | "scroll" | undefined' is not assignable to type '"visible" | "hidden" | undefined'.
    And so on...

My dependencies (package json):
"react-native": "0.72.4",
"react": "18.2.0",
"react-native-size-matters": "^0.4.0",
"typescript": "4.8.4"

err-1
err-2

same issue

what have you changed in your index.d.ts @vladbelozertsev

@basilrao
I made fork and fix this errors. You can copy code from link below and paste it to the same file at your node_modules folder. Please write feedback about errors, for me it works fine. Mb it have not enough StringifiedStyles (i.e. we have to add all css styles that consume a number value)

fixed index.d.ts

I just gonna do the patch for now before u merge this PR i guess

merged and published, thanks @vladbelozertsev!