score:0
you can use react.statelesscomponent
generic to pass your prop types as follows:
interface iheaderprops {
current: number;
total: number;
}
const header:react.statelesscomponent<iheaderprops> = (props) => {
return (
...
)
}
score:5
stepbar should accept a props object with members as current and total.
can you try using something like :
function stepbar(props: {current: number, total: number}) { ... }
Source: stackoverflow.com
Related Query
- CombineReducers with Typescript returns error "Argument of type is not assignable to parameter of type 'ReducersMapObject'"
- React Typescript error in TextArea : Type 'string' is not assignable to type number
- Creating reusable Button Component with React and Typescript with not assignable type error
- Typescript error 'argument of type is not assignable to parameter of type'
- TypeScript error : Type '.....' is not assignable to type 'IntrinsicAttributes & Number'
- Withrouter Error using function component and typescript jsx.element' is not assignable to parameter of type routecomponentprops
- React Typescript error Type '{ id: number; title: string; function(): void; }' is not assignable to type 'null'
- Cryptic Typescript compiler error using React: 'ComponentClass<StyledComponentProps<{}>>' is not assignable to type 'typeof MyComponent'
- getting error :Type '[null, Dispatch<SetStateAction<null>>]' is not assignable to type in typescript react
- react typescript error 'Type '{ ... }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<...>
- Typescript error :: Type 'number' is not assignable to type 'never'
- Typescript error "children does not exists on type IntrinsicAttributes & RefAttributes<unknown>'.* " on react component
- Error in typescript using react framer Type '() => void' is not assignable to type 'undefined'
- Type 'string' is not assignable to type 'never' and Type 'unknown' is not assignable to type 'never' error in react typescript
- Very simple MWE, typescript error TS2322 (...) not assignable to type 'IntrinsicAttributes & Props & { children?: ReactNode; }'
- Getting a Typescript error saying, some type is not assignable to parameter of type 'ReducerWithoutAction<any>'?
- Typescript not assignable error after explicit type check
- Reactjs and typescript error TS2322: Type is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes
- Argument of type is not assignable to parameter of type Typescript Error
- Type 'string[]' is not assignable to type 'never[]'. Typescript Error
- Typescript - React Error TS2322: Type 'AppState | undefined' is not assignable to type 'ICards | undefined'
- React/Redux reducer typescript error (Type 'undefined' is not assignable to type ISupplierState)
- How to fix the error argument of type string or undefined is not assignable to parameter of type string using typescript and react?
- Typescript error on React Component: Argument of type 'Element' is not assignable to parameter of type
- TypeScript error Argument of type is not assignable to parameter of type Appstate despite having all necessary types included
- React TypeScript Error : TS2322 - Type '' is not assignable to type 'IntrinsicAttributes & String'
- TypeScript Error (TS2345) argument of type Person | undefined is not assignable to paramater of type Person
- Typescript Compilation Error with React - Type 'Element' is not assignable to type 'FunctionComponent<{}>'
- Typescript returning error Argument of type is not assignable but it seems like it is confusing one function for another
- TypeScript Error Argument of type '{}' is not assignable to parameter of type 'Variable Y'
More Query from same tag
- ReactJS : Moderate severity vulnerabilities while running create react-app
- React context provider is not passing value even for simplest form
- Export a function as default while destructuring it for uses within the same class
- Counter increment in state not updating
- Saving count variable when closing Dialog in React
- initialvalues is not shown in react-select when using with redux form
- React/Redux not rendering nextState
- React Navigation switching background colors and styling StackNavigator
- How to position a popup box (child page) in a React table (parent) in a relative manner - CSS/ReactJS/Javascript
- How to make a Tab type simple component in React
- Looping to clear all numbers colors in react
- div in grandchild don't handle onClick event by handler passed as props
- How to limit the range of an element?
- JSX from Component in parent as a string
- Multiple uses of single store on same page
- Get field value on change using Formik
- What's the proper way to grab an object from my Entities dictionary in a Normalized state and pass it to a component?
- DirectionsRenderer and DirectionsService @react-google-maps/api not getting rendered and also not throwing error
- React Js AwesmeSlider Autoplay
- Javascript class instance method does not work with onClick callback event in react
- MUI ClickAwayListener closing the modal itself when clicked (React.Js)
- React: Perform action, only once, when html element is clicked
- How I can Add Start and end point in stacked bar chart in chart js?
- Export function into hook
- How to access values from context in a separate functional component
- Set Timeout running 4 times each minute
- how do i get formik to update an input on click?
- ReactJS: state not updated after setState and callback
- How to develop react app via online development
- Modal only shows last element of mapped array in React