use-context-selector
use-context-selector copied to clipboard
`createContext` return type is `any`
So this doesn't seem to be an issue with the library(maybe), but the returned type for createContext is any when I hover over it VSCode, but if I try writing something with it, the autocomplete correctly completes the fields.
Looking at the type definition in the node_modules, and it looks correct to me.
The weirdest thing is if I hover over Context.Provider, it shows the correct type.
Interesting...
I wonder if this as any does anything wired.
https://github.com/dai-shi/use-context-selector/blob/9e5174ea4ca2725c9177e5c672e1dcd880186ede/src/index.ts#L110
Happy to see anyone has any suggestions.
@heyitsarpit are you using typescript or just the vscode intellisense? just to be sure
@heyitsarpit are you using typescript or just the vscode intellisense? just to be sure
The codebase is typescript, the screenshot I posted are vscode's on hover type inspection.
This might be a bug in TypeScript (from the code path which shows the hover information), can you make a repro that works in the TypeScript playground?
@orta The issue is a year old and I just checked and don't observer this behaviour anymore. Things working as expected. I guess we can close the issue.