🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

react-native-patina

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-patina - npm Package Compare versions

Comparing version
0.1.3
to
0.1.4
+6
-0
CHANGELOG.md
# react-native-patina
## 0.1.4 (2021-07-07)
### Fixed
- Be more explicit about component return types, to help Flow & Typescript return more accurate errors.
## 0.1.3 (2020-08-19)

@@ -4,0 +10,0 @@

+7
-7

@@ -18,10 +18,10 @@ import * as React from 'react';

export interface ThemeContext<Theme> {
getTheme(): Theme;
changeTheme(theme: Theme): void;
watchTheme(callback: WatchCallback<Theme>): Unsubscribe;
ThemeProvider: React.ComponentType<ThemeProviderProps>;
useTheme(): Theme;
withTheme<Props extends {
getTheme: () => Theme;
changeTheme: (theme: Theme) => void;
watchTheme: (callback: WatchCallback<Theme>) => Unsubscribe;
ThemeProvider: (props: ThemeProviderProps) => JSX.Element;
useTheme: () => Theme;
withTheme: <Props extends {
theme: Theme;
}>(Component: React.ComponentType<Props>): React.ComponentType<RemoveTheme<Props>>;
}>(Component: React.ComponentType<Props>) => (props: RemoveTheme<Props>) => JSX.Element;
}

@@ -28,0 +28,0 @@ /**

{
"name": "react-native-patina",
"version": "0.1.3",
"version": "0.1.4",
"private": false,
"description": "A simple, type-aware theming library",
"keywords": [
"react native",
"styles",
"theming",
"theme"
],
"repository": "git@github.com:EdgeApp/react-native-patina",

@@ -18,12 +24,8 @@ "license": "MIT",

"scripts": {
"fix": "npm run lint -- --fix",
"lint": "eslint --ext .js,.jsx,.ts,.tsx .",
"precommit": "lint-staged && yarn prepare",
"prepare": "rimraf lib && tsc && cp src/index.flow.js lib/index.js.flow"
"build": "rimraf lib && tsc && cp src/index.flow.js lib/index.js.flow",
"fix": "eslint . --fix",
"lint": "eslint .",
"precommit": "lint-staged && npm run build",
"prepare": "husky install && npm run build"
},
"husky": {
"hooks": {
"pre-commit": "npm run precommit"
}
},
"lint-staged": {

@@ -33,28 +35,23 @@ "*.{js,jsx,ts,tsx}": "eslint"

"devDependencies": {
"@types/react": "^16.8.23",
"@types/react-native": "^0.62.0",
"@typescript-eslint/eslint-plugin": "^2.0.0",
"@typescript-eslint/parser": "^2.0.0",
"babel-eslint": ">=10.0.0",
"eslint": ">=6.2.2",
"eslint-config-standard-kit": ">=0.14.2",
"eslint-plugin-flowtype": ">=4.3.0",
"eslint-plugin-import": ">=2.18.0",
"eslint-plugin-prettier": ">=3.0.0",
"eslint-plugin-promise": ">=4.2.1",
"eslint-plugin-react": ">=7.14.2",
"eslint-plugin-simple-import-sort": ">=4.0.0",
"eslint-plugin-standard": ">=4.0.0",
"@types/react": "^17.0.14",
"@types/react-native": "^0.64.11",
"@typescript-eslint/eslint-plugin": "^4.8.2",
"@typescript-eslint/parser": "^4.8.2",
"babel-eslint": "^10.1.0",
"eslint": "^7.14.0",
"eslint-config-standard-kit": "0.15.1",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"eslint-plugin-simple-import-sort": "^6.0.1",
"flow-bin": "^0.127.0",
"husky": "^4.0.0",
"lint-staged": "^10.2.0",
"prettier": "^2.0.0",
"husky": "^7.0.1",
"lint-staged": "^10.5.3",
"prettier": "^2.2.0",
"rimraf": "^3.0.0",
"typescript": "^3.5.3"
},
"importSort": {
".js, .ts, .tsx": {
"style": "module"
}
"typescript": "^4.1.2"
}
}

@@ -38,3 +38,3 @@ // @flow

Component: React.ComponentType<Props>
): React.ComponentType<RemoveTheme<Theme, Props>>
): (props: RemoveTheme<Theme, Props>) => React.Node
}

@@ -41,0 +41,0 @@

@@ -26,12 +26,12 @@ import * as React from 'react'

// Direct theme access:
getTheme(): Theme
changeTheme(theme: Theme): void
watchTheme(callback: WatchCallback<Theme>): Unsubscribe
getTheme: () => Theme
changeTheme: (theme: Theme) => void
watchTheme: (callback: WatchCallback<Theme>) => Unsubscribe
// React component access:
ThemeProvider: React.ComponentType<ThemeProviderProps>
useTheme(): Theme
withTheme<Props extends { theme: Theme }>(
ThemeProvider: (props: ThemeProviderProps) => JSX.Element
useTheme: () => Theme
withTheme: <Props extends { theme: Theme }>(
Component: React.ComponentType<Props>
): React.ComponentType<RemoveTheme<Props>>
) => (props: RemoveTheme<Props>) => JSX.Element
}

@@ -81,3 +81,3 @@

Component: React.ComponentType<Props>
): React.ComponentType<RemoveTheme<Props>> {
): (props: RemoveTheme<Props>) => JSX.Element {
function WithTheme(props: RemoveTheme<Props>): JSX.Element {

@@ -84,0 +84,0 @@ const theme = React.useContext(Context)

Sorry, the diff of this file is not supported yet