Skip to content

fix: remove unused useState import in lifecycle-of-reactive-effects#8483

Open
jahanzaib-iqbal-dev wants to merge 1 commit into
reactjs:mainfrom
jahanzaib-iqbal-dev:fix/unused-usestate-import-lifecycle-effects
Open

fix: remove unused useState import in lifecycle-of-reactive-effects#8483
jahanzaib-iqbal-dev wants to merge 1 commit into
reactjs:mainfrom
jahanzaib-iqbal-dev:fix/unused-usestate-import-lifecycle-effects

Conversation

@jahanzaib-iqbal-dev

Copy link
Copy Markdown

Summary

The ChatRoom.js sandpack in the "Fix a connection switch" challenge on the Lifecycle of Reactive Effects page imports useState but the component only uses useEffect. The unused import can confuse learners who may wonder why it's there.

Before:

import { useState, useEffect } from 'react';

After:

import { useEffect } from 'react';

Fixes #8231

The ChatRoom.js sandpack in the "Fix a connection switch" challenge
imports useState but only uses useEffect. Remove the unused import
to avoid confusing learners.

Fixes reactjs#8231
@github-actions

Copy link
Copy Markdown

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@jahanzaib-iqbal-dev

Copy link
Copy Markdown
Author

@rickhanlonii @gaearon small one-line fix removing an unused useState import that could confuse learners. CI is green — would appreciate a review when you get a chance! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mistake]: Learn > Escape Hatches > Lifecycle of Reactive Effects

1 participant