Socket
Socket
Sign inDemoInstall

@callstack/react-theme-provider

Package Overview
Dependencies
Maintainers
9
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@callstack/react-theme-provider - npm Package Compare versions

Comparing version 3.0.5 to 3.0.6

2

package.json
{
"name": "@callstack/react-theme-provider",
"version": "3.0.5",
"version": "3.0.6",
"description": "Theme provider for react and react-naitve applications",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -73,15 +73,5 @@ <p align="center">

You can also use the [hooks](https://reactjs.org/docs/hooks-intro.html) based API:
Another usage for functional component:
```js
function App() {
const theme = useTheme();
return <div style={{ color: theme.primaryColor }}>Hello</div>;
}
```
### Usage
```js
const App = ({ theme }) => (

@@ -96,2 +86,12 @@ <div style={{ color: theme.primaryColor }}>

You can also use the [hooks](https://reactjs.org/docs/hooks-intro.html) based API:
```js
function App() {
const theme = useTheme();
return <div style={{ color: theme.primaryColor }}>Hello</div>;
}
```
### Injected props

@@ -199,15 +199,2 @@

## Applying a custom theme to a component
If you want to change the theme for a certain component, you can directly pass the theme prop to the component. The theme passed as the prop is merged with the theme from the Provider.
```js
import * as React from 'react';
import MyButton from './MyButton';
export default function ButtonExample() {
return <MyButton theme={{ roundness: 3 }}>Press me</MyButton>;
}
```
#### `useTheme`

@@ -214,0 +201,0 @@

@@ -7,3 +7,3 @@ // Type definitions for @callstack/react-theme-provider 1.0.2

type $Without<T, K> = Pick<T, Exclude<keyof T, K>>;
type $Without<T, K extends keyof any> = T extends any ? Pick<T, Exclude<keyof T, K>> : never;
type $DeepPartial<T> = { [P in keyof T]?: $DeepPartial<T[P]> };

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc