openBackhaul / RequestSequenceRepresentation

Graphical representation of Request Flows
Apache License 2.0
0 stars 2 forks source link

Fixed flow diagram printing twice by removing restrict mode of react #34

Closed sunil-kumar-meena closed 1 year ago

sunil-kumar-meena commented 1 year ago

Fix https://github.com/openBackhaul/RequestSequenceRepresentation/issues/33

sunil-kumar-meena commented 1 year ago

@PrathibaJee

Without Strict Mode when we create/mount any component this is what happens

  • React mounts the component.
    • Layout effects are created.
    • Effects are created.

With Strict Mode when we create/mount any component this is what happens

  • React mounts the component.
    • Layout effects are created.
    • Effects are created.
  • React simulates effects being destroyed on a mounted component.
    • Layout effects are destroyed.
    • Effects are destroyed.
  • React simulates effects being re-created on a mounted component.
    • Layout effects are created
    • Effect setup code runs

Components are creating twice with strict mode in react

PrathibaJee commented 1 year ago

@sunil-kumar-meena , many thanks for fixing the issue and explaining the solution in detail.