score:0
Accepted answer
the render looks good to me, i think the problem is that your component is rendering without waiting for your erquest response.
what about using async/await?
like so
async componentdidmount() {
const {data} = await axios.get("http://localhost:8080/rfx/all");
this.setstate({ listrfx : data })
}
hope this help.
Source: stackoverflow.com
Related Query
- React - uncaught TypeError: Cannot read property 'setState' of undefined
- react router v^4.0.0 Uncaught TypeError: Cannot read property 'location' of undefined
- React with ES7: Uncaught TypeError: Cannot read property 'state' of undefined
- React enzyme testing, Cannot read property 'have' of undefined
- Cannot read property 'history' of undefined (useHistory hook of React Router 5)
- React - TypeError: Cannot read property 'props' of undefined
- React Router: Cannot read property 'pathname' of undefined
- React Typescript: Line 0: Parsing error: Cannot read property 'name' of undefined
- Cannot read property '.then' of undefined when testing async action creators with redux and react
- React Tutorial: TypeError: Cannot read property 'props' of undefined
- TypeError: Cannot read property 'javascript' of undefined + terser webpack plugin + react js
- React Material-UI Modal TypeError: Cannot read property 'hasOwnProperty' of undefined
- How to test form submission in React with Jest and Enzyme? Cannot read property 'preventDefault' of undefined
- React propType cannot read property of undefined
- React cannot read property map of undefined
- TypeError: Cannot read property 'prototype' of undefined React Express
- TypeError: Cannot read property 'error' of undefined on React Chrome Extension
- mocha + jsdom + React TypeError: Cannot read property 'addEventListener' of undefined
- React - Cannot read property 'call' of undefined
- Cannot read property 'forEach' of undefined in React
- Cannot read property 'call' of undefined Webpack Bootstrap React
- Uncaught TypeError: Cannot read property 'toUpperCase' of undefined react state item
- Cannot read property 'map' of undefined with react hooks
- Cannot read property 'map' of undefined in React
- React Redux: Cannot read property 'dispatch' of undefined
- React Jest test Cannot read property 'pathname' of undefined
- React Redux Cannot read property 'dispatch' of undefined
- React - Uncaught TypeError: Cannot read property 'func' of undefined
- react / redux - cannot read property "yyy" of undefined
- Cannot read property of undefined when using react hooks
More Query from same tag
- Conditionally adding more JSX to React component based on ternary statement
- Prompt user before the session ends
- How to use React Native launch options parameter for RCTRootView
- Search bar not displaying results in React
- In graphql, what is the best way to combine multiple sources where fields in both sources share a common value?
- How to declare proptypes to validate an array of specific strings?
- Convert document.querySelector() into Reactjs
- Cant equalize value of input to a react useState Hook
- React render Onsen UI Toolbar
- How to test if method was called inside componentDidMount?
- ES6 Map Reduce array flatten with mapping and padding from Redux state
- `moduleNameMapper` settings in jest.config.js doesn't work on CircleCI
- React Js: prevent line breaks or submit on enter in the text area
- react-i18next: strings not being translated
- Trying to select menuItems in a seperate component - how to solve 'function components cannot be given refs' error?
- React Hook is called in function that is neither a React function component nor a custom React Hook function
- React.DOM.p(null, message) - explain null?
- React Redux problem on dispatching on button
- New object is being added every time I type a letter
- React JS - Link with data-toggle doesn't redirect to url
- Custom useEffect Second Argument
- How can I decrease input height with floating labels?
- React input element value edit field
- Converting existing Rails + React application to React on Rails with Server Side Rendering (SSR)
- How to access the methods of the react-google-maps components?
- How I can add Local Storage to my React.js app?
- Setting Interval speed using setState in React.js
- Got a little bit of a problem here when passing parameters thru react link, I`ve got "TypeError: Cannot read property 'location' of undefined"
- for what purpose we write e.target.name into the state definition statement?
- React doesn't render array value from firebase and array's length is 0 despite having the value on console