score:1
the error was caused by the shorthand syntax and not due to the component type. the following resolved the error posted above:
return (
<>
{!isauthenticating && (
<div>
<appcontext.provider
value={{ isauthenticated, userhasauthenticated }}
>
<navbarelement />
<routes />
<footerelement />
</appcontext.provider>
</div>
)}
</>
);
};
Source: stackoverflow.com
Related Query
- What Type should be used on a React Component that returns a Boolean or JSX?
- Typescript type declarations for Promise that returns a React Component
- What type should I use for a React component with arbitrary properties?
- React / NextJS: Type error: 'Component' cannot be used as a JSX component
- What type should I use to match FunctionComponent that returns a div?
- What is the correct way to type a React component class that has no props?
- What should the React children type be for components that only accept text and falsy?
- Component cannot be used as a JSX component. Its return type 'Element[]' is not a valid JSX element
- Jest Enzyme test a React component that returns null in render method
- How do I wrap a React component that returns multiple table rows and avoid the "<tr> cannot appear as a child of <div>" error?
- What is React component 'displayName' is used for?
- What TypeScript type should NextJS _app.tsx Component and pageProps be?
- what is the correct type for a React instance of a component in typescript
- Using JS React component in TypeScript: JSX element type 'MyComponent' is not a constructor function for JSX elements
- React functional component vs. plain-old JS function that returns React element
- React - cannot be used as a JSX component. Its return type 'void' is not a valid JSX element
- What TypeScript type should React children be set to?
- What is the Typescript type to accept any kind of React Component as prop?
- What is the simplest way of testing that a React Component contains a html node with enzyme?
- React component function returning JSX causes error when used in render method of ES6 class React component
- How to type a Typescript React Component that accepts a Context with a super-set of properties
- How to form a TypeScript rule/config that errors if I don't return a JSX in React Functional Component
- How to type a React component that accepts another component as a prop, and all of that component's props?
- What should be a React Component and what should be just an HTML?
- what should a React checkbox alike component expose as API?
- How to check what additional props were passed into a react component that were not defined?
- TypeScript + React: Enforce that component returns another type of component
- React typescript - Type must have a '[Symbol.iterator]()' method that returns an iterator
- When passing a React functional Component as a parameter of a function, how should I declare the function parameter type with TS
- What type i should pass to my imageIcon props in react typescript?
More Query from same tag
- Open a table on click of the another td in react js
- React match by id and map to return in div
- React + Redux: Changing input focus programatically
- Prevent useState value from being reset when props change
- Passing text field input from child component to parent
- Modal Window not detect well I click on the Login or Sign up button
- ReactJS how to set input Textfield to display current Date and time?
- Getting data synchronously using map and dataservice
- How to convert date's format from Jul 02 2020 00:00:00 GMT+0800 to mm/dd/yyyy in React?
- Arrays and React
- How to access environment variables in react from docker and webpack
- React Hook "useDispatch" cannot be called at the top level. React Hooks must be called in a React function component or a custom React Hook function
- Get sell to specific countries field from API in woocommerce
- How to pass props to {this.props.children}
- How to move the data lables to the center in react apex charts
- React, Get Weather Aync Await Errors
- React useEffect if user is null. redirect
- How to implement fetch API by search
- Get clicked location latitude and longitude
- setState() not changing the value
- How do I pass an element's property to a function in React?
- How to upload files along with posting a complex object
- React Component env variables from project for imported component
- How to update the React state when a parameter of the state is a Map?
- Upload image from ReactJS to Firebase v9 Storage
- Best way to get HTTP data and handle a 404?
- Error: Invariant Violation: Touchable child must either be native or forward setNativeProps to a native component stack
- React private route not redirecting to index page [React-Router "5.2.0"]
- Reading data of a DataContext object
- Cannot read property 'location' of undefined (useLocation())