props.children is not defined.
I have this component.
My IDE is telling me that
const AuthProvider: Component<AuthContextProps> = (props) => {
/// the local store.
const [tokenStorage, setTokenStorage] = createLocalStorage({
api: localStorage,
prefix: "vista-auth-",
deserializer: (data) => {
if (!data || data == "undefined") {
return "";
}
return data;
},
serializer: (value, key, options) => {
return value;
},
});
const [auth, setAuth] = createStore({
access: tokenStorage.access,
refresh: tokenStorage.refresh,
get authenticated(): boolean {
const hasAccess = this.access.length > 0;
const hasRefresh = this.refresh.length > 0;
return hasAccess || hasRefresh;
},
} as AuthState);
return (
<AuthContext.Provider value={auth}>
{props.children!}
</AuthContext.Provider>
);
};const AuthProvider: Component<AuthContextProps> = (props) => {
/// the local store.
const [tokenStorage, setTokenStorage] = createLocalStorage({
api: localStorage,
prefix: "vista-auth-",
deserializer: (data) => {
if (!data || data == "undefined") {
return "";
}
return data;
},
serializer: (value, key, options) => {
return value;
},
});
const [auth, setAuth] = createStore({
access: tokenStorage.access,
refresh: tokenStorage.refresh,
get authenticated(): boolean {
const hasAccess = this.access.length > 0;
const hasRefresh = this.refresh.length > 0;
return hasAccess || hasRefresh;
},
} as AuthState);
return (
<AuthContext.Provider value={auth}>
{props.children!}
</AuthContext.Provider>
);
};My IDE is telling me that
props.childrenprops.children isn't defined somehow. I'm guessing this is just some typing problem? How would I fix this?