From 74d35d6c34d58407304bd6fc52ffabf81c8cfb7e Mon Sep 17 00:00:00 2001 From: ajay-dhangar Date: Tue, 21 May 2024 22:44:22 +0530 Subject: [PATCH 1/4] resolved some issues --- src/pages/helloReact.js | 1 - src/theme/Admonition/Layout/Types.js | 1 - src/theme/Admonition/Layout/index.js | 1 - 3 files changed, 3 deletions(-) diff --git a/src/pages/helloReact.js b/src/pages/helloReact.js index 3f627838f..a6180da4c 100644 --- a/src/pages/helloReact.js +++ b/src/pages/helloReact.js @@ -1,4 +1,3 @@ -import React from 'react'; import Layout from '@theme/Layout'; export default function Hello() { diff --git a/src/theme/Admonition/Layout/Types.js b/src/theme/Admonition/Layout/Types.js index c16173685..a04ab9ab8 100644 --- a/src/theme/Admonition/Layout/Types.js +++ b/src/theme/Admonition/Layout/Types.js @@ -1,4 +1,3 @@ -import React from 'react'; import DefaultAdmonitionTypes from '@theme-original/Admonition/Types'; function MyCustomAdmonition(props) { diff --git a/src/theme/Admonition/Layout/index.js b/src/theme/Admonition/Layout/index.js index 515448c46..ce5b1e063 100644 --- a/src/theme/Admonition/Layout/index.js +++ b/src/theme/Admonition/Layout/index.js @@ -1,4 +1,3 @@ -import React from 'react'; import clsx from 'clsx'; import {ThemeClassNames} from '@docusaurus/theme-common'; import styles from './styles.module.css'; From 741a752f8073d46f7eed7994db209e2094352b13 Mon Sep 17 00:00:00 2001 From: ajay-dhangar Date: Tue, 21 May 2024 22:55:07 +0530 Subject: [PATCH 2/4] resolved some issues --- .../advanced-react-concepts/Component.js | 2 -- .../advanced-react-concepts/withLogger.js | 2 -- .../component-optimization/LazyLoadingExample.js | 2 +- .../component-optimization/MemoizationExample.js | 3 +-- .../VirtualizationExample.js | 1 - .../building-user-interfaces/IfElseExample.js | 2 +- .../building-user-interfaces/KeyPropExample.js | 2 -- .../building-user-interfaces/ListExample.js | 2 -- .../TernaryOperatorExample.js | 2 +- .../building-your-first-react-app/Counter.js | 2 +- .../building-your-first-react-app/MyComponent.js | 15 ++------------- .../WelcomeMessage.js | 2 -- .../introduction-to-forms/FormComponent.js | 2 +- .../ChangeEventExample.js | 2 +- .../ComplexStateExample.js | 2 +- .../SubmitEventExample.js | 2 +- .../intermidiate-level/handling-data-flow/App.js | 1 - .../handling-data-flow/Content.js | 2 +- .../handling-data-flow/Header.js | 2 +- .../handling-data-flow/ReduxApp/Counter.js | 1 - .../handling-data-flow/ReduxApp/index.js | 1 - .../handling-data-flow/ThemeContext.js | 2 +- .../managing-complex-uis/App.js | 2 +- .../managing-complex-uis/ParentComponent.js | 1 - .../managing-complex-uis/TodoApp.js | 2 +- .../managing-complex-uis/TodoList.js | 1 - .../working-with-apis/UserList.js | 2 +- src/components/TeamProfileCards/index.tsx | 7 ------- 28 files changed, 17 insertions(+), 52 deletions(-) diff --git a/courses/react-js/advanced-level/advanced-react-concepts/Component.js b/courses/react-js/advanced-level/advanced-react-concepts/Component.js index 8132c176f..92076e5ad 100644 --- a/courses/react-js/advanced-level/advanced-react-concepts/Component.js +++ b/courses/react-js/advanced-level/advanced-react-concepts/Component.js @@ -1,5 +1,3 @@ -import React from "react"; - import withLogger from "./withLogger"; const Component = ({ message }) => { diff --git a/courses/react-js/advanced-level/advanced-react-concepts/withLogger.js b/courses/react-js/advanced-level/advanced-react-concepts/withLogger.js index 25f55f1a3..8f7711e07 100644 --- a/courses/react-js/advanced-level/advanced-react-concepts/withLogger.js +++ b/courses/react-js/advanced-level/advanced-react-concepts/withLogger.js @@ -1,5 +1,3 @@ -import React from "react"; - const withLogger = (WrappedComponent) => { return (props) => { console.log(`Rendering ${WrappedComponent.name} with props:`, props); diff --git a/courses/react-js/advanced-level/component-optimization/LazyLoadingExample.js b/courses/react-js/advanced-level/component-optimization/LazyLoadingExample.js index 6193212e8..8b1719bd3 100644 --- a/courses/react-js/advanced-level/component-optimization/LazyLoadingExample.js +++ b/courses/react-js/advanced-level/component-optimization/LazyLoadingExample.js @@ -1,4 +1,4 @@ -import React, { Suspense } from "react"; +import { Suspense } from "react"; const LazyComponent = React.lazy(() => import("./LazyComponent")); const LazyLoadingExample = () => { return ( diff --git a/courses/react-js/advanced-level/component-optimization/MemoizationExample.js b/courses/react-js/advanced-level/component-optimization/MemoizationExample.js index 4d0a596e1..3a1383615 100644 --- a/courses/react-js/advanced-level/component-optimization/MemoizationExample.js +++ b/courses/react-js/advanced-level/component-optimization/MemoizationExample.js @@ -1,8 +1,7 @@ -import React, { useMemo, useState } from "react"; +import { useMemo, useState } from "react"; const ExpensiveComponent = ({ value }) => { const expensiveFunction = (value) => { - // Expensive computation return value * 2; }; const memoizedValue = useMemo(() => expensiveFunction(value), [value]); diff --git a/courses/react-js/advanced-level/component-optimization/VirtualizationExample.js b/courses/react-js/advanced-level/component-optimization/VirtualizationExample.js index b57247973..e263924ce 100644 --- a/courses/react-js/advanced-level/component-optimization/VirtualizationExample.js +++ b/courses/react-js/advanced-level/component-optimization/VirtualizationExample.js @@ -1,4 +1,3 @@ -import React from "react"; import { FixedSizeList } from "react-window"; const VirtualizationExample = () => { const Row = ({ index, style }) =>
Row {index}
; diff --git a/courses/react-js/begginer-level/building-user-interfaces/IfElseExample.js b/courses/react-js/begginer-level/building-user-interfaces/IfElseExample.js index a1ad756bc..ad860680a 100644 --- a/courses/react-js/begginer-level/building-user-interfaces/IfElseExample.js +++ b/courses/react-js/begginer-level/building-user-interfaces/IfElseExample.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; function IfElseExample() { const [isLoggedIn, setIsLoggedIn] = useState(false); diff --git a/courses/react-js/begginer-level/building-user-interfaces/KeyPropExample.js b/courses/react-js/begginer-level/building-user-interfaces/KeyPropExample.js index 84729071b..c8e550e06 100644 --- a/courses/react-js/begginer-level/building-user-interfaces/KeyPropExample.js +++ b/courses/react-js/begginer-level/building-user-interfaces/KeyPropExample.js @@ -1,5 +1,3 @@ -import React from "react"; - function KeyPropExample() { const items = [ { id: 1, name: "Apple" }, diff --git a/courses/react-js/begginer-level/building-user-interfaces/ListExample.js b/courses/react-js/begginer-level/building-user-interfaces/ListExample.js index bb432baf8..344e49e77 100644 --- a/courses/react-js/begginer-level/building-user-interfaces/ListExample.js +++ b/courses/react-js/begginer-level/building-user-interfaces/ListExample.js @@ -1,5 +1,3 @@ -import React from "react"; - function ListExample() { const items = ["Apple", "Banana", "Cherry", "Date"]; diff --git a/courses/react-js/begginer-level/building-user-interfaces/TernaryOperatorExample.js b/courses/react-js/begginer-level/building-user-interfaces/TernaryOperatorExample.js index 48547149b..295b9b658 100644 --- a/courses/react-js/begginer-level/building-user-interfaces/TernaryOperatorExample.js +++ b/courses/react-js/begginer-level/building-user-interfaces/TernaryOperatorExample.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; function TernaryOperatorExample() { const [isError, setIsError] = useState(false); diff --git a/courses/react-js/begginer-level/building-your-first-react-app/Counter.js b/courses/react-js/begginer-level/building-your-first-react-app/Counter.js index 29ace4244..1935c23f0 100644 --- a/courses/react-js/begginer-level/building-your-first-react-app/Counter.js +++ b/courses/react-js/begginer-level/building-your-first-react-app/Counter.js @@ -1,4 +1,4 @@ -import React, { Component } from "react"; +import { Component } from "react"; class Counter extends Component { constructor(props) { diff --git a/courses/react-js/begginer-level/building-your-first-react-app/MyComponent.js b/courses/react-js/begginer-level/building-your-first-react-app/MyComponent.js index 6d2ed0efe..6dae7775f 100644 --- a/courses/react-js/begginer-level/building-your-first-react-app/MyComponent.js +++ b/courses/react-js/begginer-level/building-your-first-react-app/MyComponent.js @@ -1,40 +1,29 @@ -import React from 'react'; - -// Define a functional component using JSX const MyComponent = () => { - // Define some variables to use in JSX expressions const name = "Ajay"; const isLoggedIn = true; const fruits = ["apple", "banana", "orange"]; - // JSX component rendering return (

Hello, {name}!

- {/* Embedding expressions */}

{isLoggedIn ? "You are logged in" : "Please log in"}

- {/* Defining attributes */} Ajay - {/* Conditionally render elements */} {isLoggedIn &&

Welcome back, {name}!

} - {/* Mapping over arrays */}
    - {fruits.map((fruit, index) => ( -
  • {fruit}
  • + {fruits.map((fruit) => ( +
  • {fruit}
  • ))}
- {/* Compose components */}
); } -// Another component to compose const Button = ({ text, onClick }) => { return ; } diff --git a/courses/react-js/begginer-level/building-your-first-react-app/WelcomeMessage.js b/courses/react-js/begginer-level/building-your-first-react-app/WelcomeMessage.js index d63691b5e..78fd4f26f 100644 --- a/courses/react-js/begginer-level/building-your-first-react-app/WelcomeMessage.js +++ b/courses/react-js/begginer-level/building-your-first-react-app/WelcomeMessage.js @@ -1,5 +1,3 @@ -import React from "react"; - function WelcomeMessage() { return
Welcome to React!
; } diff --git a/courses/react-js/begginer-level/introduction-to-forms/FormComponent.js b/courses/react-js/begginer-level/introduction-to-forms/FormComponent.js index b7524f7e4..242fc2f4d 100644 --- a/courses/react-js/begginer-level/introduction-to-forms/FormComponent.js +++ b/courses/react-js/begginer-level/introduction-to-forms/FormComponent.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; function FormComponent() { const [formData, setFormData] = useState({ diff --git a/courses/react-js/begginer-level/working-with-components-and-data/ChangeEventExample.js b/courses/react-js/begginer-level/working-with-components-and-data/ChangeEventExample.js index b1ee04c88..8bf62332f 100644 --- a/courses/react-js/begginer-level/working-with-components-and-data/ChangeEventExample.js +++ b/courses/react-js/begginer-level/working-with-components-and-data/ChangeEventExample.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import { useState } from 'react'; function ChangeEventExample() { const [value, setValue] = useState(''); diff --git a/courses/react-js/begginer-level/working-with-components-and-data/ComplexStateExample.js b/courses/react-js/begginer-level/working-with-components-and-data/ComplexStateExample.js index 6e961bb89..43e301c9a 100644 --- a/courses/react-js/begginer-level/working-with-components-and-data/ComplexStateExample.js +++ b/courses/react-js/begginer-level/working-with-components-and-data/ComplexStateExample.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; function ComplexStateExample() { const [user, setUser] = useState({ name: "Ajay", age: 24 }); diff --git a/courses/react-js/begginer-level/working-with-components-and-data/SubmitEventExample.js b/courses/react-js/begginer-level/working-with-components-and-data/SubmitEventExample.js index a04976bb3..853acf1f2 100644 --- a/courses/react-js/begginer-level/working-with-components-and-data/SubmitEventExample.js +++ b/courses/react-js/begginer-level/working-with-components-and-data/SubmitEventExample.js @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import { useState } from 'react'; function SubmitEventExample() { const [value, setValue] = useState(''); diff --git a/courses/react-js/intermidiate-level/handling-data-flow/App.js b/courses/react-js/intermidiate-level/handling-data-flow/App.js index 59272b283..5a6733004 100644 --- a/courses/react-js/intermidiate-level/handling-data-flow/App.js +++ b/courses/react-js/intermidiate-level/handling-data-flow/App.js @@ -1,4 +1,3 @@ -import React from "react"; import { ThemeProvider } from "./ThemeContext"; import Header from "./Header"; import Content from "./Content"; diff --git a/courses/react-js/intermidiate-level/handling-data-flow/Content.js b/courses/react-js/intermidiate-level/handling-data-flow/Content.js index d457c7448..9340917a5 100644 --- a/courses/react-js/intermidiate-level/handling-data-flow/Content.js +++ b/courses/react-js/intermidiate-level/handling-data-flow/Content.js @@ -1,4 +1,4 @@ -import React, { useContext } from "react"; +import { useContext } from "react"; import { ThemeContext } from "./ThemeContext"; function Content() { diff --git a/courses/react-js/intermidiate-level/handling-data-flow/Header.js b/courses/react-js/intermidiate-level/handling-data-flow/Header.js index bf46a690a..4b1602fd2 100644 --- a/courses/react-js/intermidiate-level/handling-data-flow/Header.js +++ b/courses/react-js/intermidiate-level/handling-data-flow/Header.js @@ -1,4 +1,4 @@ -import React, { useContext } from "react"; +import { useContext } from "react"; import { ThemeContext } from "./ThemeContext"; function Header() { diff --git a/courses/react-js/intermidiate-level/handling-data-flow/ReduxApp/Counter.js b/courses/react-js/intermidiate-level/handling-data-flow/ReduxApp/Counter.js index 5bac4174d..452fca4e1 100644 --- a/courses/react-js/intermidiate-level/handling-data-flow/ReduxApp/Counter.js +++ b/courses/react-js/intermidiate-level/handling-data-flow/ReduxApp/Counter.js @@ -1,4 +1,3 @@ -import React from "react"; import { connect } from "react-redux"; function Counter({ count, increment, decrement }) { diff --git a/courses/react-js/intermidiate-level/handling-data-flow/ReduxApp/index.js b/courses/react-js/intermidiate-level/handling-data-flow/ReduxApp/index.js index 7672a724b..3e6535c5d 100644 --- a/courses/react-js/intermidiate-level/handling-data-flow/ReduxApp/index.js +++ b/courses/react-js/intermidiate-level/handling-data-flow/ReduxApp/index.js @@ -1,4 +1,3 @@ -import React from "react"; import { Provider } from "react-redux"; import store from "./store"; import Counter from "./Counter"; diff --git a/courses/react-js/intermidiate-level/handling-data-flow/ThemeContext.js b/courses/react-js/intermidiate-level/handling-data-flow/ThemeContext.js index 5038bcb8a..f7ac17acb 100644 --- a/courses/react-js/intermidiate-level/handling-data-flow/ThemeContext.js +++ b/courses/react-js/intermidiate-level/handling-data-flow/ThemeContext.js @@ -1,4 +1,4 @@ -import React, { createContext, useState } from "react"; +import { createContext, useState } from "react"; const ThemeContext = createContext(); diff --git a/courses/react-js/intermidiate-level/managing-complex-uis/App.js b/courses/react-js/intermidiate-level/managing-complex-uis/App.js index 31f3e8cb2..5739fcd09 100644 --- a/courses/react-js/intermidiate-level/managing-complex-uis/App.js +++ b/courses/react-js/intermidiate-level/managing-complex-uis/App.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; import ParentComponent from "./ParentComponent"; function App() { diff --git a/courses/react-js/intermidiate-level/managing-complex-uis/ParentComponent.js b/courses/react-js/intermidiate-level/managing-complex-uis/ParentComponent.js index 14b84b967..1c2f0cb91 100644 --- a/courses/react-js/intermidiate-level/managing-complex-uis/ParentComponent.js +++ b/courses/react-js/intermidiate-level/managing-complex-uis/ParentComponent.js @@ -1,4 +1,3 @@ -import React from "react"; import ChildComponent from "./ChildComponent"; function ParentComponent({ count, incrementCount }) { diff --git a/courses/react-js/intermidiate-level/managing-complex-uis/TodoApp.js b/courses/react-js/intermidiate-level/managing-complex-uis/TodoApp.js index 80312e3d1..c41fd0802 100644 --- a/courses/react-js/intermidiate-level/managing-complex-uis/TodoApp.js +++ b/courses/react-js/intermidiate-level/managing-complex-uis/TodoApp.js @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; import TodoList from "./TodoList"; function TodoApp() { diff --git a/courses/react-js/intermidiate-level/managing-complex-uis/TodoList.js b/courses/react-js/intermidiate-level/managing-complex-uis/TodoList.js index 44fabcfeb..7f7c77d58 100644 --- a/courses/react-js/intermidiate-level/managing-complex-uis/TodoList.js +++ b/courses/react-js/intermidiate-level/managing-complex-uis/TodoList.js @@ -1,4 +1,3 @@ -import React from "react"; import TodoItem from "./TodoItem"; function TodoList({ todos, toggleTodo }) { diff --git a/courses/react-js/intermidiate-level/working-with-apis/UserList.js b/courses/react-js/intermidiate-level/working-with-apis/UserList.js index a06cd021f..3b158954f 100644 --- a/courses/react-js/intermidiate-level/working-with-apis/UserList.js +++ b/courses/react-js/intermidiate-level/working-with-apis/UserList.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect } from "react"; +import { useState, useEffect } from "react"; function UserList() { const [users, setUsers] = useState([]); diff --git a/src/components/TeamProfileCards/index.tsx b/src/components/TeamProfileCards/index.tsx index 8798ef0b7..9063eb6f6 100644 --- a/src/components/TeamProfileCards/index.tsx +++ b/src/components/TeamProfileCards/index.tsx @@ -1,10 +1,3 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - import React, { type ReactNode } from "react"; import Translate from "@docusaurus/Translate"; import Link from "@docusaurus/Link"; From b99e432eb3e29201aba5e3490a7dba5f6e233c5f Mon Sep 17 00:00:00 2001 From: ajay-dhangar Date: Tue, 21 May 2024 23:01:03 +0530 Subject: [PATCH 3/4] resolved some issues --- .../component-optimization/LazyLoadingExample.js | 2 +- .../component-optimization/MemoizationExample.js | 3 ++- .../building-your-first-react-app/MyComponent.js | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/courses/react-js/advanced-level/component-optimization/LazyLoadingExample.js b/courses/react-js/advanced-level/component-optimization/LazyLoadingExample.js index 8b1719bd3..6193212e8 100644 --- a/courses/react-js/advanced-level/component-optimization/LazyLoadingExample.js +++ b/courses/react-js/advanced-level/component-optimization/LazyLoadingExample.js @@ -1,4 +1,4 @@ -import { Suspense } from "react"; +import React, { Suspense } from "react"; const LazyComponent = React.lazy(() => import("./LazyComponent")); const LazyLoadingExample = () => { return ( diff --git a/courses/react-js/advanced-level/component-optimization/MemoizationExample.js b/courses/react-js/advanced-level/component-optimization/MemoizationExample.js index 3a1383615..4d0a596e1 100644 --- a/courses/react-js/advanced-level/component-optimization/MemoizationExample.js +++ b/courses/react-js/advanced-level/component-optimization/MemoizationExample.js @@ -1,7 +1,8 @@ -import { useMemo, useState } from "react"; +import React, { useMemo, useState } from "react"; const ExpensiveComponent = ({ value }) => { const expensiveFunction = (value) => { + // Expensive computation return value * 2; }; const memoizedValue = useMemo(() => expensiveFunction(value), [value]); diff --git a/courses/react-js/begginer-level/building-your-first-react-app/MyComponent.js b/courses/react-js/begginer-level/building-your-first-react-app/MyComponent.js index 6dae7775f..245dab8b5 100644 --- a/courses/react-js/begginer-level/building-your-first-react-app/MyComponent.js +++ b/courses/react-js/begginer-level/building-your-first-react-app/MyComponent.js @@ -14,8 +14,8 @@ const MyComponent = () => { {isLoggedIn &&

Welcome back, {name}!

}
    - {fruits.map((fruit) => ( -
  • {fruit}
  • + {fruits.map((fruit, index) => ( +
  • {fruit}
  • ))}
@@ -24,6 +24,7 @@ const MyComponent = () => { ); } +// Another component to compose const Button = ({ text, onClick }) => { return ; } From 1eaf6dac8649485535b0f85c1f74c02ec42edd19 Mon Sep 17 00:00:00 2001 From: ajay-dhangar Date: Tue, 21 May 2024 23:03:23 +0530 Subject: [PATCH 4/4] resolved some issues --- .../building-your-first-react-app/MyComponent.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/courses/react-js/begginer-level/building-your-first-react-app/MyComponent.js b/courses/react-js/begginer-level/building-your-first-react-app/MyComponent.js index 245dab8b5..6d2ed0efe 100644 --- a/courses/react-js/begginer-level/building-your-first-react-app/MyComponent.js +++ b/courses/react-js/begginer-level/building-your-first-react-app/MyComponent.js @@ -1,24 +1,34 @@ +import React from 'react'; + +// Define a functional component using JSX const MyComponent = () => { + // Define some variables to use in JSX expressions const name = "Ajay"; const isLoggedIn = true; const fruits = ["apple", "banana", "orange"]; + // JSX component rendering return (

Hello, {name}!

+ {/* Embedding expressions */}

{isLoggedIn ? "You are logged in" : "Please log in"}

+ {/* Defining attributes */} Ajay + {/* Conditionally render elements */} {isLoggedIn &&

Welcome back, {name}!

} + {/* Mapping over arrays */}
    {fruits.map((fruit, index) => (
  • {fruit}
  • ))}
+ {/* Compose components */}
);