score:2
Please, do not use any
unless you are in the process of migrating a js project to ts (or you REALLY don't care what type the variable will be, even then you still should consider using unknown type instead.)
As for your problem, if I were you, for the quick and dirty way of displaying the "unknown" data I would do something like this (or just console.log
it if data is too large):
...
<h1>{ JSON.stringify(job) }</h1>
...
And I am guessing, from the error you just mentioned (and from the above script that will justify my guess if you include it), job
is a nested object, which is not valid data for displaying in React. Probably you should destructure your job
variable inside JobBoardComponent
.
Again, you can avoid these kind of errors if you give your job
variable a non-any
type, linter will warn you if you are assigning wrong types, which you can't when using any
.
Source: stackoverflow.com
Related Query
- Objects are not valid as a React child (found: object with keys {username}). If you meant to render a collection of children, use an array instead
- Error: Objects are not valid as a React child (found: object with keys {}). If you meant to render a collection of children, use an array instead
- Objects are not valid as a React child (found: object with keys {name}). If you meant to render a collection of children, use an array instead
- Objects are not valid as a React child (found: object with keys {job}). If you meant to render a collection of children, use an array instead
- Objects are not valid as a React child (found: object with keys {totalItems}). If you meant to render a collection of children, use an array instead
- Objects are not valid as a React child (found: object with keys {arr}). If you meant to render a collection of children, use an array instead
- Error: Objects are not valid as a React child (found: object with keys {}). If you meant to render a collection of children, use an array instead. JS
- Objects are not valid as a React child (found: object with keys {weight}). If you meant to render a collection of children, use an array instead
- Error: Objects are not valid as a React child (found: object with keys {name}). If you meant to render a collection of children, use an array instead
- Objects are not valid as a React child (found: object with keys {children}). If you meant to render a collection of children, use an array instead
- Error: Objects are not valid as a React child (found: object with keys {value}). If you meant to render a collection of children, use an array instead
- Objects are not valid as a React child (found: object with keys {items}). If you meant to render a collection of children, use an array instead
- My error: Objects are not valid as a React child (found: object with keys {}). If you meant to render a collection of children, use an array instead
- How to fix Objects are not valid as a React child (found: object with keys {}). If you meant to render a collection of children, use an array instead
- Objects are not valid as a React child (found: object with keys {})/If you meant to render a collection of children, use an array instead. Help me?
- Uncaught Error: Objects are not valid as a React child (found: object with keys {todo}). If you meant to render a collection of children, use an array
- Objects are not valid as a React child (found: object with keys {id, name}). If you meant to render a collection of children, use an array instead
- React native - objects are not valid as a React child (found: object with keys {$$typeof, type, key, ref, props, _owner, _store})
- Objects are not valid as a React child (found: object with keys {})
- Objects are not valid as a React child (found: object with keys {children}): ReactJS
- React.js Error: " Objects are not valid as a React child (found: object with keys {})."
- Error: Objects are not valid as a React child (found: object with keys {id, name})
- Error: Objects are not valid as a React child (found: object with keys {$$typeof, type, compare, WrappedComponent, displayName})
- Error: Objects are not valid as a React child (found: object with keys {}). use an array instead
- Error: Objects are not valid as a React child (found: object with keys {})
- React with Router v5 Error: Objects are not valid as a React child (found: object with keys {children})
- Objects are not valid as a React child (found: object with keys). If you meant to render a collection of children, use an array instead
- Objects are not valid as a React child (found: object with keys {children})
- 'Error: Objects are not valid as a React child (found: object with keys {results, info})'
- Error: Objects are not valid as a React child (found: object with keys {zip})
More Query from same tag
- Reactjs/Graphql: TypeError: Object(...) is not a function
- Storing long text-based paragraphs or headings in React.js
- Can the routes /users, /users/:id, and /users/online co-exist with react-router?
- this.state.persons.map is not a function
- React select - change the way selected values are shown
- React router and PropType validation of variables that haven't been initialized
- How to define a custom tooltip in Apex chart in React?
- React component displaying dynamic data based on URL
- Tuple type in Typescript PropTypes
- laravel broadcasting - client receives one response several times
- Reactjs Spring-boot security
- Cannot assign to read only property of object '#<Object>'
- numbers are added to the current number
- react router: using a menu on all pages but the frontpage
- why my req.files always null while req.body have the file :upload file with express-fileupload/reactjs
- Editing entered text on double click using react
- How to globally style dynamic react data (dangerouslySetInnerHTML) with styled-components?
- React call API filter out undefined promises
- React-Table get row where button is clicked
- How to properly use and move between react routers?
- Is there a more functional way to merge and foreach/sort two arrays in TypeScript, React?
- How should the react component re-render itself when props from redux have been updated?
- ReactJS: get data from form
- Infinite Loop of Images using React and Firestore Database - How do I get my data?
- Dynamic object keys... Cannot create property on string
- React truncate text by line
- ANTD React How can I do affix like antd website?
- Socket.io not emitting messages to a specific user
- How to wait the end of an Action Creator?
- convert json from multiple parent id to single parent in javascript