Questions tagged [componentwillreceiveprops]

10 questions
4
votes
1 answer

Expo SDK 36, a generic resolution for "componentWillReceiveProps has been renamed, and is not recommended for use" errors

When I run expo start the warning I receive is: Warning: componentWillReceiveProps has been renamed, and is not recommended for use. ... * Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict…
1
vote
1 answer

How to move away from componentWillReceiveProps

As componentWillReceiveProps is deprecated, How do we migrate the below code? componentWillReceiveProps (nextProps) { if (nextProps.reloadData && nextProps.realoadDataId) { this.props.onChange({target: {id: 'reloadData', value:…
1
vote
0 answers

React Native birthday picker - componentWillREceiveProps

I need to build a birthday picker for a react naive application. I found the following https://github.com/ericmorgan1/react-native-birthday-picker but it has the deprecated method componentWillREceiveProps Im not that experienced yet, so i don't…
1
vote
2 answers

React props value is undefined

This is my parent code: class Parent extends Component { constructor(props) { super(props); this.state = { tags: [], }; } componentDidMount() { this.getTags(); } getTags() { …
0
votes
1 answer

how to use getDerivedStateFromProps instead of componentWillReceiveProps in React

I like to update my code to use getDerivedStateFromProps instead of componentWillReceiveProps as the I am receiving deprecated error. The component is receiving a date prop and every time the date is changed in need to run the getList with the new…
0
votes
1 answer

Conditional render in drawer navigator React Native

I am programming small app in React Native with Redux. When user register, I want to show him "Setup screen" where he can set up his bank account. Also when he log in or register, I am checking his bank account on the backend in Redux and then send…
0
votes
1 answer

Updating props doesn't invoke componentWillReceiveProps method

In the UI I have two buttons, addRow & removeRow. AddRow adds a new row with dropdowns and removeRow removes them. For some reason, the clicking the remove row doesn't removes the row from the UI. The parent class is a functional component: export…
magi
  • 131
  • 1
  • 3
  • 18
0
votes
1 answer

React component lifecycle componentWillReceiveProps deprecation causes problem with Redux

I have 2 components, one that is used to add new post to an array of posts and another component that maps through that array of posts and lists them on the page. I want to add the new post to the top of the array with unshift(), but ever since…
0
votes
1 answer

React Native componentWillReceiveProps doesn't call right when I update Redux

Ok so this are my buttons where I add and delete from cart in ProductScreen : {this.addToCart()}}> add to cart
0
votes
2 answers

I am not being able to stop using componentWIllReceiveProps / getDerivedStateFromProps

I'm new to React (and programming world actually) and I just found that we shouldn't need to use componentWIllReceiveProps / getDerivedStateFromProps at all, but i have this issue: I have a parent component, LoginForm, in which I fetch my API and…