Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot consume props in functional components react hooks #3789

Open
anuk112 opened this issue Aug 29, 2021 · 1 comment
Open

cannot consume props in functional components react hooks #3789

anuk112 opened this issue Aug 29, 2021 · 1 comment

Comments

@anuk112
Copy link

anuk112 commented Aug 29, 2021

"react-native-router-flux": "^4.2.0"

i have try to added params

Actions.Ikakoy({actives: 2})

but when i want to get the params using react hooks the value was undefined, my code is like this

......
import React, { useState, useEffect, useRef } from 'react'

const Ikakoy = (props) => {
    .........
    .........
   
    useEffect(()=>{
        console.log(props.actives) // i got undefined
        return () => { unmounted.current = true }
    },[])

    ........
}
export default Ikakoy

any solutions?

@sushantb21
Copy link

any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants