Skip to content

Commit

Permalink
fix: defaultValue is not passsed (#7470)
Browse files Browse the repository at this point in the history
  • Loading branch information
r1tsuu committed Mar 20, 2023
1 parent 0f8a500 commit 62454c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/clean-tips-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@chakra-ui/react-context": patch
---

`createContext`: Fix issue where `defaultValue` is not passing
3 changes: 2 additions & 1 deletion packages/hooks/context/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ export function createContext<T>(options: CreateContextOptions<T> = {}) {
hookName = "useContext",
providerName = "Provider",
errorMessage,
defaultValue,
} = options

const Context = createReactContext<T | undefined>(undefined)
const Context = createReactContext<T | undefined>(defaultValue)

Context.displayName = name

Expand Down

1 comment on commit 62454c1

@vercel
Copy link

@vercel vercel bot commented on 62454c1 Mar 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.