Describe the bug
A clear and concise description of what the bug is.
The declaration const { product, selectedItem } = useProduct() cause a TS error that indicate "Property 'selectedItem' does not exist on type 'Partial"
To Reproduce
Steps to reproduce the behavior:
- import Product Context
- use useProduct Hook with destructuring syntax
Expected behavior
no type error
Desktop environment:
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz Memory: 2.13 GB / 15.79 GB
Binaries:
Node: 14.15.5 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.19041.964.0), Chromium (90.0.818.66) Internet Explorer: 11.0.19041.1
Describe the bug
A clear and concise description of what the bug is.
The declaration
const { product, selectedItem } = useProduct()cause a TS error that indicate "Property 'selectedItem' does not exist on type 'Partial"To Reproduce
Steps to reproduce the behavior:
Expected behavior
no type error
Desktop environment:
System:
OS: Windows 10 10.0.19042
CPU: (8) x64 Intel(R) Core(TM) i7-10510U CPU @ 1.80GHz Memory: 2.13 GB / 15.79 GB
Binaries:
Node: 14.15.5 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 6.14.11 - C:\Program Files\nodejs\npm.CMD
Browsers:
Edge: Spartan (44.19041.964.0), Chromium (90.0.818.66) Internet Explorer: 11.0.19041.1