Search code examples
reactjsreact-propsreact-functional-component

React Form Submit


I am pretty new to react and still learning to use it. I have a component with a form that I want to take the data during submission and transfer it to another component where I will display a card with that data. I tried several ways with props but failed I would be grateful if someone could help me. Thank you.

I have a component with a form that I want to take the data during submission and transfer it to another component where I will display a card with that data. I tried several ways with props but failed


Solution

  • I like RxJs (in React, NextJS, everywhere) for reactive component communication. Check it out!

    BTW: for others who think that it looks shocking, it's actually okish to write the password into state here ^^ at least according to:

    Storing form inputs in component state in React.js, specifically passwords

    Please just pay attention all the way, it's a password, usually you want to keep it server only and let a session decide whether to ask for it again.