https://github.com/kristerkari/react-native-types-for-css-modules
React Native Typescript types with an extra added type: className property
https://github.com/kristerkari/react-native-types-for-css-modules
classname css-modules react-native types typescript
Last synced: 10 months ago
JSON representation
React Native Typescript types with an extra added type: className property
- Host: GitHub
- URL: https://github.com/kristerkari/react-native-types-for-css-modules
- Owner: kristerkari
- License: mit
- Created: 2018-01-24T14:41:11.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-23T02:18:41.000Z (almost 2 years ago)
- Last Synced: 2025-03-19T09:14:12.452Z (10 months ago)
- Topics: classname, css-modules, react-native, types, typescript
- Language: Ruby
- Homepage:
- Size: 583 KB
- Stars: 14
- Watchers: 3
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Typescript types for React Native CSS modules
[](https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github)
[React Native Typescript types](https://www.npmjs.com/package/@types/react-native) with an extra added type: `className` property.
These types should be used together with [React Native CSS modules](https://github.com/kristerkari/react-native-css-modules).
## Installation
**The `package.json` alias feature used here is only supported by Yarn. The feature is not supported by npm.**
Replace normal `@types/react-native` installation...
```json
"@types/react-native": "^0.57.55",
```
...with this (versions `>=0.52.4` are supported):
```json
"@types/react-native": "kristerkari/react-native-types-for-css-modules#v0.57.55",
```
...and run `yarn install`.
You can also omit the version tag (not recommended):
```json
"@types/react-native": "kristerkari/react-native-types-for-css-modules",
```
## Keeping in sync with new `@types/react-native` versions
New `@types/react-native` versions are being regularly published from the [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) repository.
It would be too difficult and time consuming to manually update the `className` type to each new version of `@types/react-native`. That's why there is a Ruby script that looks for new `@types/react-native` versions from `npm` and creates a new version to this repository.
Use `ruby update_versions.rb` to update `className` type to newer `@types/react-native` version(s).