-
Notifications
You must be signed in to change notification settings - Fork 50.6k
Closed
Labels
Resolution: StaleAutomatically closed due to inactivityAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug
Description
React version: 16.13.1
Steps To Reproduce
import React, { useState } from "react";
console.log(React, useState)
The import declaration is taken straight from the hooks documentation (https://reactjs.org/docs/hooks-intro.html), hence why I expected it to work.
Save as bug.mjs, run with node bug.mjs (node v13 or later).
The current behavior
file:///…/bug.mjs:1
import React, { useState } from "react";
^^^^^^^^
SyntaxError: The requested module 'react' does not provide an export named 'useState'
at ModuleJob._instantiate (internal/modules/esm/module_job.js:92:21)
at async ModuleJob.run (internal/modules/esm/module_job.js:107:20)
at async Loader.import (internal/modules/esm/loader.js:179:24)
The expected behavior
No Syntax Error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Resolution: StaleAutomatically closed due to inactivityAutomatically closed due to inactivityStatus: UnconfirmedA potential issue that we haven't yet confirmed as a bugA potential issue that we haven't yet confirmed as a bug