Skip to content

ref.current returns null or undefined #375

Open

Description

@ur-gh

Dev Env: EXPO - WEB
useRef followed by assigning ref to Picker returns null or undefined ( however it was initialized ).

Originally, I was trying to disable the left and right arrows from changing the picker values. Decided to see if ref use will somehow help only to find ref is not being set.

example code:
const r = React.useRef();
useEffect(() => {
console.log(r.current); //remains undefined here
}, []);

.
.
.
<Picker
ref={r}
selectedValue={userFilter}
style={{ width: 150 }}

            >

...

Activity

  1. changed the title [-]ref returns null or undefined[/-] [+]ref.current returns null or undefined[/+] on Feb 2, 2022
  2. LucioChavezFuentes commented on Feb 11, 2022

    @LucioChavezFuentes
    Contributor

    I also have this issue on Web but I open a pull request that fixes this problem, I hope it can be reviewed soon.

  3. emrahaydemir commented on Dec 28, 2024

    @emrahaydemir

    Unfortunately the same problem persists on android and ios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions