I am putting together a boilerplate sample of:
- React 16.x (from create-react-app)
- Typescript
- with functional components
- Material-UI
- Mobx-React
- via context providers
- ESLint
I have almost everything worked out, but I can't seem to figure out this one ESLint error I am getting. I have a MobX store provider that looks like this
import { useLocalStore } from 'mobx-react';
import React from 'react';
import { StoreType } from '../Types/StoreType';
import { StoreContext } from './StoreContext';
export const StoreProvider = ({ children }) => {
const store = useLocalStore(() => ({
loginStore: { email: ['[email protected]'] },
applicationStore: { firstName: 'neil', lastName: 'peart' }
})) as StoreType;
return <StoreContext.Provider value={store}>{children}</StoreContext.Provider>;
};
I am getting the error:
6:30 warning Missing return type on function @typescript-eslint/explicit-function-return-type
6:33 error 'children' is missing in props validation react/prop-types
If you want to pull the whole thing down, you can here: https://github.com/Savij/functional-react-mobx-material
Appreciate any insight! -J