Open FrederickEngelhardt opened 2 years ago
Okay if anyone wants this change without adding patch package you can use my github's tag with this change forked off master.
https://github.com/VirtualizeLLC/react-native-extended-stylesheet/releases/tag/0.12.1
Replace your react-native-extended-stylesheet with this github tag in package.json and run yarn
"react-native-extended-stylesheet": "github:VirtualizeLLC/react-native-extended-stylesheet#0.12.1",
Noting that the mixin types will not pass the typesafety due to them being strings when numbers are expected in many areas.
Steps to Reproduce
Any stylesheet.create() object key click for type completion in vscode
Example
Expected Behavior
Expect to resolve the object and key location in the .ts file.
Actual Behavior
The typings resolve to the node_modules/react-native-extended-stylesheet/types/index.d.ts declaration file
Show the code
Possible temp fix is to have a basic object and then export the EStylesheet and coherce the type as a typeof the raw object.
Example:
I'm doing this as a workaround and it will resolve to the containerStylesRaw object.
Followup solution
Replace the create and child methods with the NamedStyles type used in
Stylesheet.create
.Make only the return use the type join to avoid having type errors when combining View, Text style properties in a single .create()
Environment