Skip to content

Commit

Permalink
Update Session 8 Theory.md
Browse files Browse the repository at this point in the history
  • Loading branch information
subham-prasad authored Sep 11, 2023
1 parent 5a7fcb3 commit 65796d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Chapter 08 - Let's get Classy/Theory/Session 8 Theory.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const router = createBrowserRouter([
element: <Child />,
children: [ // nested routing for subchild
{
path: "/child",
path: "child", // Don't use '/' because then react-router-dom will understand it it's the direct path
element: <SubChild />,
}
],
Expand Down Expand Up @@ -82,4 +82,4 @@ The main difference between super() and super(props) is the this.props is undefi


## Q: (Research) Why can't we have the `callback function` of `useEffect async`?
A: `useEffect` expects it's callback function to return nothing or return a function (cleanup function that is called when the component is unmounted). If we make the callback function as `async`, it will return a `promise` and the promise will affect the clean-up function from being called.
A: `useEffect` expects it's callback function to return nothing or return a function (cleanup function that is called when the component is unmounted). If we make the callback function as `async`, it will return a `promise` and the promise will affect the clean-up function from being called.

0 comments on commit 65796d2

Please sign in to comment.