You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,15 @@
1
1
# Changelog
2
2
3
+
## 1.0.1
4
+
_18 December 2021_
5
+
6
+
* Fix publish error
7
+
8
+
## 1.0.0
9
+
_18 December 2021_
10
+
11
+
***Breaking change**: Removed the `interceptors` feature that was deprecated in version 0.2.1. [Read more about this here](https://github.com/goransh/react-super-context/wiki/Interceptors-deprecated).
12
+
* Updated naming convention of the context objects/functions to use PascalCase (like a component) instead of camelCase in readme and examples
Copy file name to clipboardExpand all lines: README.md
+26-26Lines changed: 26 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# react-super-context
2
2
3
-
A tiny wrapper library around the React Context API that reduces the amount of boilerplate code required to create and consume contexts.
3
+
A tiny wrapper library around the [React Context API](https://reactjs.org/docs/context.html) that removes a lot of boilerplate required to create and consume contexts.
**1**. Use the `createSuperContext` function to create your context. It takes a factory function that returns the context's value and returns a context object as well as a hook to consume the state.
**2**. To create a provider for the context, add the `SuperContext` component in your app and pass it the `counterContext` created by the `createSuperContext` call.
110
+
**2**. To create a provider for the context, add the `SuperContext` component in your app and pass it the `CounterContext` created by the `createSuperContext` call.
`evenOrOddContext` depends on `counterContext` so if they were given the other way around (`contexts={[evenOrOddContext, counterContext]}`), then the `useCounter` call in `EvenOrOddContext.ts` will throw an error.
161
+
`EvenOrOddContext` depends on `CounterContext` so if they were given the other way around (`contexts={[EvenOrOddContext, CounterContext]}`), then the `useCounter` call in `EvenOrOddContext.ts` will throw an error.
If you have defined the context's value type explicitly, you must pass the prop type as the second generic argument (at least [until TypeScript gets support for partial type argument inference](https://github.com/microsoft/TypeScript/issues/26242)).
0 commit comments