Skip to content

nhanitk14dev/bookworm-react-redux

Repository files navigation

React - Redux Thunk - TypeScripts

I. Installation

In the project directory, you can run available Scripts:

Start Project: npm start

Test: npm test

Build: npm run build

Eject: npm run eject

Server Backend: npm run backend

Open http://localhost:3000 to view it in the browser.

Open http://localhost:8080 to view the endpoints API in the browser which we can access the data json.

Structure Project:

--src
----components
-------Header
-------Footer
------------Footer.style.tsx
------------Footer.tsx
----pages // web page screen
-------home
-------users
------------User.tsx
------------EditUser.tsx
----features // redux thunk
----models
----routes
----services
----styles

III. Learning Skills

III. Features App

IV. Notes

We wrap our content first with <BrowserRouter>.

Then we define our <Routes>. An application can have multiple <Routes>. Our basic example only uses one. <Route>s can be nested. The first <Route> has a path of / and renders the Layout component.

The nested <Route>s inherit and add to the parent route. So the blogs path is combined with the parent and becomes /blogs.

The Home component route does not have a path but has an index attribute. That specifies this route as the default route for the parent route, which is /. Setting the path to * will act as a catch-all for any undefined URLs. This is great for a 404 error page.

The Layout component has <Outlet> and <Link> elements. The <Outlet> renders the current route selected. <Link> is used to set the URL and keep track of browsing history. Anytime we link to an internal path, we will use <Link> instead of <a href="">. The "layout route" is a shared component that inserts common content on all pages, such as a navigation menu.

Suspense component, which allows us to show some fallback content such as a loading indicator) while we’re waiting for the lazy component to load.

Should use end slash with single tag such as: [<br/>, <input />, ...] in React.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •