Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

213
Views
Warning: componentWillReceiveProps is depreciated, need to find an alternative for this lifecycle method

This is my interface

    interface FloatingLabelState {
        paddingAnim: Animated.Value;
        opacityAnim: Animated.Value;
        useNativeDriver :boolean;
    }

This is my componentWillReceiveProps function

componentWillReceiveProps(newProps: FloatingLabelProps) {
        Animated.timing(this.state.paddingAnim, {
            toValue: newProps.visible ? 5 : 9,
            duration: 230,
            useNativeDriver:this.state.useNativeDriver
        }).start();
        return Animated.timing(this.state.opacityAnim, {
            toValue: newProps.visible ? 1 : 0,
            duration: 230,
            useNativeDriver:this.state.useNativeDriver
        }).start();
    }

With many resources, came to know that static getDerivedStateFromProps() would be an alternative, Can someone help me convert componentWillReceiveProps to getDerivedStateFromProps method.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!