Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fluentui/react-context-selector

Package Overview
Dependencies
Maintainers
0
Versions
877
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fluentui/react-context-selector - npm Package Compare versions

Comparing version 0.0.0-nightly-20241029-0406.1 to 0.0.0-nightly-20241030-0406.1

10

CHANGELOG.md
# Change Log - @fluentui/react-context-selector
This log was last generated on Tue, 29 Oct 2024 04:11:19 GMT and should not be manually modified.
This log was last generated on Wed, 30 Oct 2024 04:11:15 GMT and should not be manually modified.
<!-- Start content -->
## [0.0.0-nightly-20241029-0406.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v0.0.0-nightly-20241029-0406.1)
## [0.0.0-nightly-20241030-0406.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v0.0.0-nightly-20241030-0406.1)
Tue, 29 Oct 2024 04:11:19 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.1.68..@fluentui/react-context-selector_v0.0.0-nightly-20241029-0406.1)
Wed, 30 Oct 2024 04:11:15 GMT
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-context-selector_v9.1.68..@fluentui/react-context-selector_v0.0.0-nightly-20241030-0406.1)

@@ -15,3 +15,3 @@ ### Changes

- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
- Bump @fluentui/react-utilities to v0.0.0-nightly-20241029-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/4ad6cff3a29abf29cc2ed98241bd31e5e2481564) by beachball)
- Bump @fluentui/react-utilities to v0.0.0-nightly-20241030-0406.1 ([commit](https://github.com/microsoft/fluentui/commit/3b037a58cfd15f9328202bddaf0dc94fc5be7265) by beachball)

@@ -18,0 +18,0 @@ ## [9.1.68](https://github.com/microsoft/fluentui/tree/@fluentui/react-context-selector_v9.1.68)

{
"name": "@fluentui/react-context-selector",
"version": "0.0.0-nightly-20241029-0406.1",
"version": "0.0.0-nightly-20241030-0406.1",
"description": "React useContextSelector hook in userland",

@@ -31,3 +31,3 @@ "main": "lib-commonjs/index.js",

"dependencies": {
"@fluentui/react-utilities": "0.0.0-nightly-20241029-0406.1",
"@fluentui/react-utilities": "0.0.0-nightly-20241030-0406.1",
"@swc/helpers": "^0.5.1"

@@ -34,0 +34,0 @@ },

# `@fluentui/react-context-selector`
React `useContextSelector()` and `useContextSelectors()` hooks in userland.
React `useContextSelector()` hook in userland.

@@ -43,3 +43,3 @@ ## Introduction

// https://reactjs.org/docs/context.html#reactcreatecontext
const CounterContext = createContext<CounterContextValue>({});
const CounterContext = createContext<CounterContextValue>({} as CounterContextValue);

@@ -49,3 +49,3 @@ const CounterProvider = CounterContext.Provider;

// not necessary but can be a good layer to mock for unit testing
const useCounterContext = <T>(selector: ContextSelector<CounterContextValue, T>) =>
const useCounterContext = <T,>(selector: ContextSelector<CounterContextValue, T>) =>
useContextSelector(CounterContext, selector);

@@ -63,6 +63,6 @@

const Counter2 = () => {
const count1 = useCounterContext(context => context.count2);
const count2 = useCounterContext(context => context.count2);
const increment = useCounterContext(context => context.incrementCount2);
return <button onClick={increment}>Counter 1: {count1}</button>;
return <button onClick={increment}>Counter 2: {count2}</button>;
};

@@ -69,0 +69,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