Stepper component in React | Frontend machine coding question

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 พ.ย. 2024

ความคิดเห็น • 26

  • @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

  • @omnikingomniking6412
    @omnikingomniking6412 ปีที่แล้ว +1

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

  • @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

  • @rbb023
    @rbb023 ปีที่แล้ว +1

    Thanks.. please keep posting

  • @sachinsingh-jb7td
    @sachinsingh-jb7td ปีที่แล้ว +1

    Nice explanation 👍

  • @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

  • @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 😂

  • @imamansoni
    @imamansoni ปีที่แล้ว +1

    👍👍

  • @vikrantnegi4747
    @vikrantnegi4747 ปีที่แล้ว +1

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

    • @Learnersbucket
      @Learnersbucket  ปีที่แล้ว +1

      Many more to come, keep practicing

    • @vikrantnegi4747
      @vikrantnegi4747 ปีที่แล้ว +1

      @@Learnersbucket Love your content