score:0
remove {}
from el1 props, because you are not specifiing object in prop types, and you have there empty object instead of undefined
and just my recommendation is to specify types of props like that:
interface iprops {
children:any
}
const children = ({children}: iprops) => {
return (
{children}
)};
instead of specifying type of component. its subjective but for me its easier to read.
Source: stackoverflow.com
Related Query
- Can't add additional items to React component (using Typescript)
- Default property value in React component using TypeScript
- How to attach drag event handlers to a React component using TypeScript
- How to use jest.spyOn with React function component using Typescript
- Typing a React component that clones its children to add extra props in TypeScript
- Sending event handlers as props into a React component using TypeScript
- Type annotation for React Higher Order Component using TypeScript
- Connecting a component with OwnProps using react redux and typescript in the .NET Core 2.0 reactredux template project
- React: How to add onChange functionality inside of Function component using React Hooks? Need onClick event from a checkbox to influence input state
- Is it possible to type a React function component with TypeScript without using arrow functions?
- Default function value in React component using Typescript
- How to add new props dynamically to the component using navigator in React Native
- Using TypeScript To Create A React Stateless Functional Component That Accepts Array
- How to properly declare type for React wrapper component (HOC) using Typescript
- How to add type FunctionComponent to React functional component using the "function" syntax and not "const"?
- How to statically type a string property within a React component using Typescript
- How to add items into specific Id using the react array map method
- How to test a component which is using a custom TypeScript React Hook?
- cant add image in react getting an error Error: Cannot find module './undefined' when using require
- how to add custom css using react styled component
- How to pass props from container component to redux form(component) - react using typescript
- How can I add or remove class using querySelectorAll() in react functional component
- Error rendering react component using Typescript and WebPack
- Using `addEventListener` to add click event to icon within React component
- how can my call the action in my component using typescript with react redux?
- Typing component state with typescript when using react hooks
- Error Coming when passing props from one component to another and vice - versa in react using typescript
- How to add alt to an svg imported as a react component using svgr
- How to call custom methods of React component while doing unit testing. I am using typescript
- Default property value in React component with extended props using TypeScript 3
More Query from same tag
- How to access component methods from “outside” in ReactJS?
- React jQuery does not recognize element as Bootstrap modal
- NPX-CRA: creating react app, using npx throws an error
- reactstrap - create-react-app - not found bootstrap/dist/css/bootstrap.css - v.4
- React material UI doesn't bind the initialValue to the AutoComplete
- run my method when redux change store props. ReactJS
- Is this pattern of coding in react.js right?
- React useImperativeHandle when element is null
- React JS API Post Throws ERR_ABORTED 415
- Function executes twice
- React - what is the proper way to reload after multiple axios requests are done
- How do I put a keyPress handler that can be used without having the button on focus?
- react router changes url but not navigating to page
- Why is props.history.push() is not redirecting
- Copy state array and keep initial value
- React.js pass parameters with Router not in URL
- Return statement leads to: Expected an assignment or function call and instead saw an expression no-unused-expressions
- How to fix "Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0" ERROR
- Ensure that input value is string of alphabets in reactjs
- Call Back function doesn't work when call from child component
- Type 'unknown[]' is not assignable to type
- A better way to update state in redux reducer
- Fetch the token only after refreshing the page. Token returns null before refreshing
- How do I avoid repeating a code in redux + react. Example inside
- React remove click event using jQuery
- How to make Next.js server waiting until action creator is fully done?
- How return a const or function in primary function
- React with MVC data annotations and unobtrusive validation
- Adding a CSS class to a JSX in ReactJS
- Require an argument depending on the presence of another argument