Stepper component in React | Frontend machine coding question

Поделиться
HTML-код
  • Опубликовано: 28 ноя 2024

Комментарии • 26

  • @rbb023
    @rbb023 Год назад +1

    Thanks.. please keep posting

  • @sachinsingh-jb7td
    @sachinsingh-jb7td Год назад +1

    Nice explanation 👍

  • @bhai14hoursconsistent
    @bhai14hoursconsistent Год назад +1

    Gajab

    • @sachinsingh-jb7td
      @sachinsingh-jb7td Год назад

      Bhai tu toh government job karne bol rha tha uss din aaj machine coding ka video dekh rha h 😂

  • @ravipanchal1639
    @ravipanchal1639 Год назад +1

    Can we move the next and prev button to the stepper only ? Will it be better instead of using it in each component and one more thing why this is requirement to keep it in the particular component does it useful in which way ? Can you share an example ?

    • @Learnersbucket
      @Learnersbucket  Год назад +1

      It is component so that navigation can be done at component's will i.e after form validation or any other validation

  • @sumanthprabhu11
    @sumanthprabhu11 Год назад +2

    Can we use Context api instead of React.clone element?

    • @Learnersbucket
      @Learnersbucket  Год назад +1

      No, cloning is better, as props are available without any further changes

  • @vikrantnegi4747
    @vikrantnegi4747 Год назад +1

    Was asked the same question in CRED's FE interview xD

  • @omnikingomniking6412
    @omnikingomniking6412 Год назад +1

    We can also use map instead of for loop right..?

  • @deepakheerakari807
    @deepakheerakari807 Год назад +1

    hey prashanth
    instead of giving buttons in each component ,what if we give the prev and next buttons in the Section itself and update the currentStep ?

    • @Learnersbucket
      @Learnersbucket  Год назад

      navigation at will, if all the validation for the given step is done then only navigate further.
      It depends upon the requirement

  • @rishabhkunwar687
    @rishabhkunwar687 Год назад +1

    How can we handle state in it , should we create it in App component and pass it to step form component and pas the state to multistepper component oe should we use context for it what would be better aprroach ?

    • @Learnersbucket
      @Learnersbucket  Год назад

      Each component will have its own state

    • @rishabhkunwar687
      @rishabhkunwar687 Год назад

      @@Learnersbucket but at the end if we want to send the request object to backend and that object needs to have data from all step form component then how we will handle it ? for eg first step form takes personal info second takes email and password then we click submit then how we will be able send reqobj which needs to have personal info as well as email and password if each component have it's local state ?

    • @Learnersbucket
      @Learnersbucket  Год назад

      @@rishabhkunwar687 you use redux as central store

    • @rishabhkunwar687
      @rishabhkunwar687 Год назад +1

      ok so either redux or context and update it whenever i click next and then while submiting we can send the central state in redux / context to backend am i right ?
      @@Learnersbucket

    • @Learnersbucket
      @Learnersbucket  Год назад

      @@rishabhkunwar687 yes

  • @imamansoni
    @imamansoni Год назад +1

    👍👍