Skip to content

Commit

Permalink
Fix: typo in context.md file (#680)
Browse files Browse the repository at this point in the history
* Typo fixed in context.md file

* README.md generated
  • Loading branch information
Sandesh-Pyakurel authored Oct 13, 2023
1 parent d768951 commit 4d44950
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ const MyComponent = () => {
};
```

However, it would be preferrable to not have to check for `null`, since we know that the context won't be `null`. One way to do that is to provide a custom hook to use the context, where an error is thrown if the context is not provided:
However, it would be preferable to not have to check for `null`, since we know that the context won't be `null`. One way to do that is to provide a custom hook to use the context, where an error is thrown if the context is not provided:

```tsx
import { createContext } from "react";
Expand Down
2 changes: 1 addition & 1 deletion docs/basic/getting-started/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const MyComponent = () => {
};
```

However, it would be preferrable to not have to check for `null`, since we know that the context won't be `null`. One way to do that is to provide a custom hook to use the context, where an error is thrown if the context is not provided:
However, it would be preferable to not have to check for `null`, since we know that the context won't be `null`. One way to do that is to provide a custom hook to use the context, where an error is thrown if the context is not provided:

```tsx
import { createContext } from "react";
Expand Down

0 comments on commit 4d44950

Please sign in to comment.