Skip to content

Bug: Related to execution/es6 #11950

@87sam12

Description

@87sam12

React version: "^17.0.2"

Steps To Reproduce

  1. Create a react app. Introduce redux in it.
  2. Import that store and provide it in the index.js while rendering the root component.

Link to code example:

The current behavior

image
image

Even after the control reaches the let assignment statement, the previous imports are undefined. Could anyone explain why is that so?
Also the following shows that the bundled internal variables are defined though:
image
image
Why does this behavior exist in javascript? Is this expected or something different.
Its in mozilla firefox browser (95.0.1)

The expected behavior

Just pls explain why is this happening in the browser (firefox 95.0.1) ? Because of this none of the variables imported have any valid values. How to use them in the file post that lines' execution?
Pl give your answer in a more descriptive manner instead of just saying that this behavior is expected. What is exactly this behavior. If this exists how can anyone use any of the imports in the file below? Whats the purpose of importing something you need above, if it will never get imported even after that line is executed?

As far as I know as javascript is a synchronous language except the specific functionalities like promises, async/await, I guess everything else must be synchronous by its design, which is why this unpredictability in its behavior is confusing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions