Code Monkey home page Code Monkey logo

Comments (5)

brennondenny avatar brennondenny commented on September 3, 2024

If I'm understanding this right, you should be able to see all your data in the state/store.

from react-stepzilla.

yarivShamash avatar yarivShamash commented on September 3, 2024

Thanks for the rapid response and apologies for my late one..

I tried passing

  handleSubmit = async e => {
    e.preventDefault();
 console.dir(this.state);
  };

To the <form onSubmit={this.handleSubmit}> that wraps <StepZilla preventEnterSubmission={true} steps={steps} />
and got an empty state after filling the form.
I also tried to console.dir(StepZilla.state) but got undefined.

Since I might have not explained correctly I am trying again.
As described above, I was converting an HTML form to StepZilla and I want to send the information collected in StepZilla to a server but I don't know where it's stored and how to access it.
The former form used:

  handleSubmit = async e => {
    e.preventDefault();
    const formElements = e.target.elements; // Here the information was stored
// rest of the function goes here, it checks and sends the data
}

Looking forward to your replay :)

from react-stepzilla.

brennondenny avatar brennondenny commented on September 3, 2024

You should not be wrapping StepZilla inside a form.

You should be using the step components, you can create a submit function that handles the submit just be sure to pass it to the component.

You should be able to use this.state in your main file but in order to access it in the components you need to be passing it in props.

Let me know if that help or if you have any more questions.

from react-stepzilla.

yarivShamash avatar yarivShamash commented on September 3, 2024

Thanks mate :)
I sorted it out by setting the input information to the parent state. All methods are there (the parent) as well and are passed as props to the children (the form steps).

from react-stepzilla.

brennondenny avatar brennondenny commented on September 3, 2024

Glad you got it working!

from react-stepzilla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.