score:1
Accepted answer
so:
p.s. i admit, that type checking works fine if i remove bracers from the argument store, like: const appcontainer: react.sfc<props> = (store) => ...
yes, this is exactly right! so the solution in your case is a very easy:
const appcontainer = ({ store }: props) => {
return (
<provider store={store}>
<title />
</provider>
)
}
this is because you declare your function arguments like in destructive way. if you will choose the non-destructive = (store) =>
you also can choose you own type-checking solution. it's not any different between both ways. you can choose one of them on you own.
score:0
i think it should be capital o in object i.e. object.
export interface props {
store: object,
dispatch(): any,
getstate(): any,
subscribe(): any,
replacereducer(): any
}
Source: stackoverflow.com
Related Query
- TS2322 - false | Element is not assignable to type ReactElement. Error does not consistently appear in app?
- React Typescript: Type 'X' is not assignable to type 'IntrinsicAttributes & { properties }. TS2322
- Very simple MWE, typescript error TS2322 (...) not assignable to type 'IntrinsicAttributes & Props & { children?: ReactNode; }'
- Type 'never[]' is not assignable to type 'never'. TS2322 in passing to the value of ContextProvider using createContext Hook
- Type '{ time: number; }' is not assignable to type 'number'. TS2322
- "Argument of type 'string' is not assignable to parameter of type never" in the parameter of the function call to get a value from an object key
- React TypeScript Error : TS2322 - Type '' is not assignable to type 'IntrinsicAttributes & String'
- Typescript + React useReducer hook error: Data object not assignable to parameter of type 'never'
- Type '{}' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes
- Type 'void' is not assignable to type '((event: MouseEvent<HTMLInputElement>) => void) | undefined'
- Type 'string' is not assignable to type '"inherit" | "initial" | "unset" | "fixed" | "absolute" | "static" | "relative" | "sticky"'
- useRef TypeScript - not assignable to type LegacyRef<HTMLDivElement>
- React Typescript - Argument of type is not assignable to parameter of type
- Argument of type 'HTMLElement | null' is not assignable to parameter of type 'Element'. Type 'null' is not assignable to type 'Element'.ts(2345)
- Argument of type 'unknown' is not assignable to parameter of type '{}'
- Type '(props: Props) => Element[]' is not assignable to type 'FunctionComponent<Props>'
- Argument of type 'Element' is not assignable to parameter of type 'ReactElement<any>
- Type 'null' is not assignable to type 'HTMLInputElement' ReactJs
- react usestate hooks error: argument of type 'yyy' is not assignable to parameter of type 'setstateaction<xx>'
- Not assignable to type IntrinsicAttributes & IntrinsicClassAttributes React.js
- Type '{}' is not assignable to type 'ReactNode'
- getting error : Argument of type '() => () => boolean' is not assignable to parameter of type 'EffectCallback'
- Typescript React/Redux : Argument of type 'typeof MyClass' is not assignable to parameter of type 'ComponentType<...'
- Type '({ items }: PropsWithChildren<TodoProps>) => Element[]' is not assignable to type 'FunctionComponent<TodoProps>'
- Using typescript in react,stateless component not assignable to type 'React.SFC'
- Type 'Requireable<string>' is not assignable to type 'Validator<"horizontal" | "vertical" | undefined>'
- React with Typescript: Argument of type 'never[]' is not assignable to parameter of type 'StateProperties | (() => StateProperties)'
- Type 'Element | undefined' is not assignable to type 'ReactElement<any, string | ((props: any)
- react-router-dom TypeScript TS2322: Type 'typeof Index' is not assignable to type
- Error: Type 'void' is not assignable to type 'ReactNode'
More Query from same tag
- Webpack load fonts
- Display proper html content in react. Content is Dynamic from Database
- Set Material UI card to max height
- React-router, Switch and Redux: Route inexplicably not rendering, no error
- How can I update the parent state by calling a function within a switch in my stateless component ?
- Proxy to backend with default Next.js dev server
- How to use WebWorkers in React using Typescript
- ReactJS call parent method
- I want to take the value of textarea and display the value at submit (react)
- How to create an index with lunr js and reactjs?
- TS2739 Type 'any[]' is missing the following properties from type 'JSON': parse, stringify, [Symbol.toStringTag]
- How to access redux wrapper inside getInitialProps?
- In Typescript, is there any way to typecheck passed-in JSX.Element's?
- React Redux set Initial State with getting data from API
- How to add dynamic code inside of a React Router Link component
- React should form elements be a separate component?
- How to fix 'Objects are not valid as a React child (found: object with keys )'
- Using electron+react.js, components are not rendered in production version
- Reactjs: getCurrentTime and display/NaN minutes
- How to get url value another page in Nextjs
- CSS grid items stacking on top of each other instead of respecting grid-area
- set react context provider state programatically from outside the tree
- Way to read filenames from directory and output to JSON with Electron & React
- moment object throws an error 'toDate' is not a function
- Integrate React router active NavLink with child component
- React Transition Between Conditionally Rendered Components
- React.js external script
- I create a build of my react app and connected with electron.js. now how to connect my backend from server folder with electron
- Resetting formik forms after changing user
- With React Conditional Rendering, how to avoid 0 being counted as undefined?