score:2
You are fetching inside the render method. this is a big NO NO.
Instead do that in the componentDidMount
life cycle method
Another thing that may or may not be related to your problem, Arrays are reference types, that means if you mutate them they still points to the same ref in the memory. this could be problematic for the Reconciliation and diff algorithm of react to determine if the state indeed changed.
when you want to change or return a new array you could simply use the ES6 spread operator:
const nextArray = [...nextProps.address]
this.setState({ center: nextArray });
EDIT
Ok i forgot to mention the most important part here :)
You are not passing any props to <BaseMap />
so you won't get any helpful data in componentWillReceiveProps
.
Source: stackoverflow.com
Related Query
- State of React child doesn't update after updating parent component
- React Child Component Not Updating After Parent State Change
- React 16.8 hooks - child component won't re-render after updating parent state
- Updating Parent Component State from Child Component with UseState React Hook
- React, updating state in child component using props after async call in parent component
- How to update parent state from child component in React + send a paramater
- react stateless child components do not update on state change in parent component
- Update parent component State from child component in react js
- Problem updating parent state from child component in React
- How to call method in child component only once after parent state update
- Updating React child component after state change
- React - Update data in the parent component after a change in child component
- React 16.0.0 Parent Child GrandChild. Updating state in Parent does not update GrandChild
- update react child component's state using props received from an async api call made in the parent component
- How can reset a React child component back to original state after it updates state in the parent
- React update child component state from parent using getDerivedStateFromProps
- React update child state from parent component
- React Updating parent state with API call and then update child
- React Child component will mount then unmount after calling parent function to set parent state
- React - I am passing state from a child to a parent component but the state value is off by one update cycle
- update state of child component from parent component using react hooks
- React Child component don't update when parent component's state update
- Checkbox doesnt update on react on child even if the parent state update?
- How to update state of parent component after the server is updated in child component?
- Child Component not updating after parent state changes.React
- React child is not updating after after parent state changed
- React - Updating Parent State from Child Form Component
- Update the state from child to parent component in React
- how to stop re-rendering of child component if parent update the context or state in react js?
- React sending async state from parent to child component after fetch in a functional component
More Query from same tag
- CSS Modules aren't being loaded for React App
- html input is not editable when added "value" parameter
- Emotion.js with create-react-app: ReferenceError: jsx is not defined
- Data are not rendering in Component with react router
- Modify Json to use into React beautiful Drag and drop
- Get sum from the nested array of objects
- React Native two time taps required for onPress event inside scrollview
- How to fix delay browser reload in webpack dev server with express
- Trying to Display Additional Image Thumbnails Below Main Featured Product Image
- React - How to prevent re-rendering of all the input fields when input changes
- How to declare plugin options, using typescript and react-chartjs-2
- React execute common code on each route change
- How to update MUI data grid table
- ref from React.forwardRef is null
- ReactJS with server side PHP templates?
- Disadvantages of making all TypeScript in a project using React with .tsx
- how do i call my variable so that it shows up on my react web app
- Error when destructuring values from useContext in TypeScript
- Sharing session when displaying the same component several times
- passing values dynamically to href attribute
- How can I use formatString correctly in Gatsby and GraphQL?
- redux saga ajax call - not working as expected
- Issue using render props to create toggle button to show/hide child components
- Async Action Redux Unhandled Rejection (Error): Actions must be plain objects. Use custom middleware for async actions
- How to align 2 cards side by side using Material UI in React, programmatically (after getting data from API])?
- React Stateless Functional Components - Laravel
- issue with reading result from POST in fetch request to Github API
- Cant show my features in openlayers. Does someone know how to solve this?
- React.js: How to use isLength in validator library?
- Socket.IO emits multiple times in a room (Using with React.js)