# Error in React, inputRef.current undefined

**URL:** <https://forum.freecodecamp.org/t/error-in-react-inputref-current-undefined/473852>\
**Category:** Curriculum Help\
**Tags:** javascript\
**Created:** [August 14, 2021, 3:25pm UTC](https://forum.freecodecamp.org/t/error-in-react-inputref-current-undefined/473852 "2021-08-14T15:25:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![veronika](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/veronika/32/134682_2.png) [@veronika](https://forum.freecodecamp.org/u/veronika)\
**Post date:** [August 14, 2021, 3:25pm UTC](https://forum.freecodecamp.org/t/error-in-react-inputref-current-undefined/473852/1 "2021-08-14T15:25:24Z")

</div>

Hello,  
I’m trying to finish the FCC projects and for product landing page I’d like to make a simple authorization form, but I’m learning that it’s not as easy as it seems. I’m learning React from Max Schwarz Müller course on Udemy and currently, I’m getting an error that my emailInputRef.current is undefined and I have no idea how to fix this. Is there anyone who would be so kind and give me an advice? 🙏

 ![error](https://global.discourse-cdn.com/freecodecamp/original/3X/6/e/6e975ba2109ce99f79e585fb5d7f09a0a37138d1.png)

---

<div class="post-metadata">

**Author:** ![kevinSmith](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/kevinsmith/32/72934_2.png) [@kevinSmith](https://forum.freecodecamp.org/u/kevinSmith)\
**Post date:** [August 14, 2021, 5:25pm UTC](https://forum.freecodecamp.org/t/error-in-react-inputref-current-undefined/473852/2 "2021-08-14T17:25:48Z")

</div>

Is there a repo? I’m guessing that the _emailInputRef_ hasn’t been set up properly.

---

<div class="post-metadata">

**Author:** ![veronika](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/veronika/32/134682_2.png) [@veronika](https://forum.freecodecamp.org/u/veronika)\
**Post date:** [August 16, 2021, 5:59pm UTC](https://forum.freecodecamp.org/t/error-in-react-inputref-current-undefined/473852/3 "2021-08-16T17:59:45Z")

</div>

Yes, the code is here: [Malailua-repo](https://github.com/malailua/Product-landing-page/blob/main/sections/SectionLogin.js) I try learning it according to the instructions and sometimes I just slightly change it and it doesn’t work. Can you find the mistake please? 🙂 Do you think it’s possible to use value instead of refs to get rid of the problem?

---

<div class="post-metadata">

**Author:** ![lasjorg](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/lasjorg/32/280761_2.png) [@lasjorg](https://forum.freecodecamp.org/u/lasjorg)\
**Post date:** [August 16, 2021, 6:30pm UTC](https://forum.freecodecamp.org/t/error-in-react-inputref-current-undefined/473852/4 "2021-08-16T18:30:48Z")

</div>

I’m guessing it’s because of your `Input` component. I assume it works with a normal input element?

> **[Refs and the DOM – React](https://reactjs.org/docs/refs-and-the-dom.html#exposing-dom-refs-to-parent-components)**
>
> A JavaScript library for building user interfaces

---

<div class="post-metadata">

**Author:** ![veronika](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/veronika/32/134682_2.png) [@veronika](https://forum.freecodecamp.org/u/veronika)\
**Post date:** [August 18, 2021, 7:40am UTC](https://forum.freecodecamp.org/t/error-in-react-inputref-current-undefined/473852/5 "2021-08-18T07:40:51Z")

</div>

Thank you 🙂 it finally works

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/freecodecamp/original/3X/e/1/e1c433102e34b46dfaa3e15d13ab9a514b127078.svg) [@system](https://forum.freecodecamp.org/u/system)\
**Post date:** [February 16, 2022, 7:41pm UTC](https://forum.freecodecamp.org/t/error-in-react-inputref-current-undefined/473852/6 "2022-02-16T19:41:23Z")

</div>

Closed on February 16, 2022, 7:41pm UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
