Skip to content

Commit 7e51bfe

Browse files
authored
Merge pull request #24 from codeharborhub/dev-1
resolve some bugs
2 parents e30c5c1 + 4ac975b commit 7e51bfe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+107
-88
lines changed

docs/react/advanced-usage/can-i-use-decorators.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebar_label: Use Decorators
55
sidebar_position: 2
66
keywords: [decorators, create react app, decorators in create react app, decorators in react, decorators in javascript, decorators in typescript]
77
description: "Learn how to use decorators in Create React App to enhance and extend the functionality of your components."
8+
hide_table_of_contents: true
89
---
910

1011

docs/react/advanced-usage/custom-templates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: custom-templates
33
title: Custom Templates
44
sidebar_label: Importing a Component
55
sidebar_position: 1
6-
keywords: [create react app, custom templates, custom template, react project, project setup, project configuration, project dependencies, project folder structure, react app, react project setup, react project configuration, react project dependencies, react project folder structure, react project template, react project scaffolding, react project boilerplate, react project starter kit, react project setup template, react project configuration template, react project dependencies template, react project folder structure template, react project scaffolding template, react project boilerplate template, react project starter kit template, react project setup boilerplate, react project configuration boilerplate, react project dependencies boilerplate, react project folder structure boilerplate, react project scaffolding boilerplate, react project starter kit boilerplate]
6+
keywords: [create react app, custom templates, custom template, react project, project setup, project configuration, boilerplate, reusable template, npm, npx, cra-template, cra-template-typescript, degit]
77
description: "Learn how to create and use custom templates in Create React App to quickly start new projects with specific configurations, dependencies, and folder structures."
88
hide_table_of_contents: true
99
---

docs/react/advanced-usage/pre-rendering-into-static-html-files.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebar_label: Pre-Rendering Static HTML
55
sidebar_position: 3
66
keywords: [pre-rendering, static html, react pre-rendering, react static html, pre-rendering in react, static html in react, react performance, react seo]
77
description: "Learn how to pre-render your React application into static HTML files to improve performance and SEO."
8+
hide_table_of_contents: true
89
---
910

1011
If you're hosting your React application using a static hosting provider, you have a fantastic opportunity to enhance its performance and SEO by pre-rendering it into static HTML files. Pre-rendering involves generating HTML pages for each route or link in your application, making them readily available to users even before the JavaScript bundle loads. This seamless process not only improves loading times but also boosts your website's visibility on search engines.

docs/react/back-end-integration/fetching-data-with-ajax-requests.md

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ sidebar_position: 2
66
tags: [React, AJAX, Data Fetching, API, Asynchronous]
77
keywords: [fetching data in react, ajax requests in react, data fetching in react, react ajax, react fetch, react data fetching, react api]
88
description: "Learn how to fetch data with AJAX requests in a React application using the `fetch()` API and the `axios` library."
9+
hide_table_of_contents: true
910
---
1011

1112
import '../css/style.css';
@@ -39,7 +40,7 @@ The `fetch()` function is a powerful tool for making AJAX requests in modern web
3940
Here's a basic example of how the `fetch()` API works:
4041

4142
```js
42-
fetch('https://api.github.com/users/Ajay-Dhangar')
43+
fetch('https://api.github.com/users/ajay-dhangar')
4344
.then((response) => response.json())
4445
.then((data) => {
4546
// Process the data here
@@ -50,7 +51,7 @@ fetch('https://api.github.com/users/Ajay-Dhangar')
5051
});
5152
```
5253

53-
In this example, we use the `fetch()` function to make a GET request to the URL `https://api.github.com/users/Ajay-Dhangar`. We then use the `then()` method to handle the response. The `response.json()` method reads the response data and parses it as JSON. Finally, we handle the parsed data or catch any errors that occurred during the request.
54+
In this example, we use the `fetch()` function to make a GET request to the URL `https://api.github.com/users/ajay-dhangar`. We then use the `then()` method to handle the response. The `response.json()` method reads the response data and parses it as JSON. Finally, we handle the parsed data or catch any errors that occurred during the request.
5455

5556
<AdsComponent />
5657

@@ -63,7 +64,7 @@ While chaining `.then()` methods works well, it can lead to callback hell when d
6364
```js title="Using async/await"
6465
async function fetchData() {
6566
try {
66-
const response = await fetch('https://api.github.com/users/Ajay-Dhangar');
67+
const response = await fetch('https://api.github.com/users/ajay-dhangar');
6768
const data = await response.json();
6869
// Process the data here
6970
console.log(data);
@@ -135,7 +136,7 @@ const DataFetcher = () => {
135136
useEffect(() => {
136137
const fetchData = async () => {
137138
try {
138-
const response = await axios.get('https://api.github.com/users/Ajay-Dhangar'); // Replace with your API endpoint
139+
const response = await axios.get('https://api.github.com/users/ajay-dhangar'); // Replace with your API endpoint
139140
setData(response.data);
140141
} catch (error) {
141142
console.error('Error fetching data:', error);
@@ -167,22 +168,25 @@ export default DataFetcher;
167168
<ul id="u_l"></ul>
168169
</div>
169170
<button onClick={()=>{
170-
let display_output_4=documet.getElementById("display_output_4")
171-
display_output_4.style.display="block"
172-
let btn4=document.getElementById("btn4")
173-
btn4.style.display="none"
174-
setTimeout(()=>{
175-
if(document.getElementById("load_ing")?.style){document.getElementById("load_ing").style.display="none";}
176-
[{id:1,name:"John"},{id:2,name:"sam"},{id:3,name:"Arjun"},{id:4,name:"siva"},{id:5,name:"Anbhu"},{id:6,name:"Krishna"}].map(item=>{
177-
let li=document.createElement("li")
178-
li.textContent=item.name
179-
let ul=document.getElementById("u_l")
180-
if(ul){
181-
ul.appendChild(li)
182-
}
183-
})
184-
},1500)
185-
}} id="btn4">click to see output</button>
171+
document.getElementById("display_output_4").style.display="block";
172+
document.getElementById("load_ing").style.display="block";
173+
document.getElementById("u_l").style.display="none";
174+
fetch('https://api.github.com/users/ajay-dhangar')
175+
.then((response) => response.json())
176+
.then((data) => {
177+
// Process the data here
178+
console.log(data);
179+
document.getElementById("load_ing").style.display="none";
180+
document.getElementById("u_l").style.display="block";
181+
let ul=document.getElementById("u_l");
182+
let li=document.createElement("li");
183+
li.appendChild(document.createTextNode(data.name));
184+
ul.appendChild(li);
185+
})
186+
.catch((error) => {
187+
console.error('Error fetching data:', error);
188+
});
189+
}} style={{marginTop:"20px",padding:"10px 20px",fontSize:"1rem",fontWeight:"600",cursor:"pointer",backgroundColor:"#61dafb",border:"none",borderRadius:"5px"}}>Fetch Data</button>
186190
</BrowserWindow>
187191

188192
In this component, we use the `useEffect` hook to fetch data from the API when the component mounts. We store the fetched data in the `data` state variable using the `useState` hook.
@@ -229,6 +233,4 @@ Congratulations! You've successfully implemented AJAX requests in your React app
229233

230234
Fetching data with AJAX requests is an integral part of building dynamic and interactive React applications. By using the `fetch()` API or libraries like axios, you can easily communicate with APIs and display data on your web pages. Additionally, leveraging `async / await` can improve the readability of your code and help manage multiple asynchronous requests more efficiently.
231235

232-
Always keep compatibility in mind when using modern features like the `fetch()` API, and consider using polyfills for older browsers. With the knowledge of data fetching in React, you're equipped to create responsive and data-driven web applications.
233-
234-
Happy coding and exploring the possibilities of data integration in your React journey!
236+
Always keep compatibility in mind when using modern features like the `fetch()` API, and consider using polyfills for older browsers. With the knowledge of data fetching in React, you're equipped to create responsive and data-driven web applications.

docs/react/back-end-integration/integrating-with-an-api-backend.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ title: Integrating with an API Backend
44
sidebar_label: Integrating with an API
55
sidebar_position: 3
66
tags: [React, API, Backend, Integration]
7-
keywords: [react, api, backend, integration, axios, fetch, http, request, post, get, put, delete, data, communication, server, client, frontend, backend, fullstack, web development, javascript, node.js, express, rest, json, asynchronous, promise, async, await, state, useEffect, useState, form, submit, create, update, delete, fetch, send, receive, response, error, axios, library, package, npm, install, tool, postman, testing, endpoint, list, data, new, component, app, file, code, example, tutorial, guide, how-to, learn, step-by-step, beginner, basics, introduction, overview, explanation, example, code, source, snippet, tutorial, guide, learn, how-to, steps, react, javascript, web development, frontend, backend, fullstack, integration, api, axios, fetch, http, request, post, get, put, delete, data, communication, server, client, frontend, backend, fullstack, web development, javascript, node.js, express, rest, json, asynchronous, promise, async, await, state, useEffect, useState, form, submit, create, update, delete, fetch, send, receive, response, error, axios, library, package, npm, install, tool, postman, testing, endpoint, list, data, new, component, app, file, code, example, tutorial, guide, how-to, learn, step-by-step, beginner, basics, introduction, overview, explanation, example, code, source, snippet, tutorial, guide, learn, how-to, steps]
7+
keywords: [react, api, backend, integration, axios, fetch, http, request, post, get, put, delete, data fetching, data posting, rest api, restful api, graphql, authentication, authorization, cors, json, xml]
88
description: "Learn how to integrate a React app with an API backend, enabling it to fetch and send data seamlessly."
9+
hide_table_of_contents: true
910
---
1011

1112

12-
Welcome to CodeMastermindHQ! In this tutorial, we will guide you through the process of integrating your React app with an API backend. By the end of this guide, you'll have a solid understanding of how to connect your frontend and backend, enabling your app to fetch and send data seamlessly.
13+
In this tutorial, we will guide you through the process of integrating your React app with an API backend. By the end of this guide, you'll have a solid understanding of how to connect your frontend and backend, enabling your app to fetch and send data seamlessly.
1314

1415
<AdsComponent />
1516

docs/react/back-end-integration/proxying-api-requests-in-development.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ title: Proxying API Requests in Development
44
sidebar_label: Proxying API Requests
55
sidebar_position: 1
66
tags: [React, API, Backend, Integration, Proxy]
7-
keywords: [react, api, backend, integration, proxy, proxying, cors, development, server, client, frontend, backend, fullstack, web development, javascript, node.js, express, rest, json, asynchronous, promise, async, await, state, useEffect, useState, form, submit, create, update, delete, fetch, send, receive, response, error, axios, library, package, npm, install, tool, postman, testing, endpoint, list, data, new, component, app, file, code, example, tutorial, guide, how-to, learn, step-by-step, beginner, basics, introduction, overview, explanation, example, code, source, snippet, tutorial, guide, learn, how-to, steps]
87
description: "Learn how to proxy API requests during development in a React app using Create React App, avoiding CORS issues and enabling seamless interaction with your backend server."
8+
hide_table_of_contents: true
99
---
1010

1111
import '../css/style.css'
@@ -53,7 +53,7 @@ Now your app should be running at `http://localhost:3000/`.
5353
<BrowserWindow>
5454
<div style={{textAlign: 'center'}}>
5555
<header style={{minHeight: '80vh', display:' flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', fontSize: 'calc(10px + 2vmin)'}}>
56-
<img src="/code-harbor-hub/img/docs/react/logo.svg" className="App-logo" alt="logo" />
56+
<img src="/tutorial/img/logo.svg" className="App-logo" alt="logo" />
5757
<br/>
5858
<p>
5959
Edit src/App.js and save to reload.
@@ -287,6 +287,4 @@ Check out the [official documentation](https://create-react-app.dev/docs/proxyin
287287

288288
Congratulations! You've successfully learned how to proxy API requests during development with Create React App. By using proxying, you've simplified your development environment and avoided troublesome CORS issues.
289289

290-
Whether you choose the built-in `proxy` field or the more flexible manual setup, understanding how to handle API requests effectively will boost your productivity and make building React apps a delightful experience.
291-
292-
Now that you've mastered proxying, you're ready to build amazing apps with seamless frontend-backend communication. Keep coding and have fun!
290+
Whether you choose the built-in `proxy` field or the more flexible manual setup, understanding how to handle API requests effectively will boost your productivity and make building React apps a delightful experience.

docs/react/back-end-integration/title-and-meta-tags.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
id: title-and-meta-tags
3-
title: Title And Meta Tags
4-
sidebar_label: Title & Meta Tags
3+
title: "Title and Meta Tags"
4+
sidebar_label: "Title & Meta Tags"
55
sidebar_position: 4
66
tags: [title, meta, tags, react, create react app, seo, search engine optimization, server, server-side, back-end, integration]
77
keywords: [title, meta, tags, react, create react app, seo, search engine optimization, server, server-side, back-end, integration]
88
description: "Learn how to handle title and meta tags in your Create React App for back-end integration, making your website more appealing and discoverable."
9+
hide_table_of_contents: true
910
---
1011

1112
import '../css/style.css'

docs/react/building-your-app/adding-a-router.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ sidebar_position: 8
55
tags: [react, react router, routing, react app, single-page application, spa, create react app, navigation, links, components]
66
keywords: [react, react router, routing, react app, single-page application, spa, create react app, navigation, links, components]
77
description: "Learn how to add routing capabilities to your React app using React Router, enabling dynamic, multi-page applications without full-page refreshes."
8+
hide_table_of_contents: true
89
---
910

1011
In the world of web development, creating dynamic and interactive applications is a common requirement. React, being a popular JavaScript library for building user interfaces, provides a powerful way to create single-page applications (SPAs). However, to enhance the user experience and enable navigation between different views or pages within your React app, you need to implement routing.

docs/react/building-your-app/adding-bootstrap.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ id: adding-bootstrap
33
title: Adding Bootstrap
44
sidebar_position: 4
55
tags: [react, create react app, bootstrap, css, styling, components, responsive, layout, design, ui, user interface, integration]
6-
keywords: [react, create react app, bootstrap, css, styling, components, responsive, layout, design, ui, user interface, integration, npm, install, package, library, framework, pre-designed, enchanting, styles, responsive, layouts, components, buttons, forms, grid, system, columns, rows, container, app, project, example, tutorial, guide, how-to, learn, step-by-step, beginner, basics, introduction, overview, explanation, example, code, source, snippet, tutorial, guide, learn, how-to, steps]
6+
keywords: [react, create react app, bootstrap, css, styling, components, responsive, layout, design, ui, user interface, integration]
77
description: "Learn how to integrate Bootstrap into your Create React App, unlocking the power of pre-designed components, responsive layouts, and enchanting styles."
8+
hide_table_of_contents: true
89
---
910

1011
import './style.css'
@@ -186,7 +187,7 @@ export default MagicalApp;
186187
<p className="lead">Prepare to be enchanted by the wonders they create together.</p>
187188
<div className="row mt-5">
188189
<div className="col-sm-6">
189-
<img src="/code-harbor-hub/img/svg/static_website.svg" alt="logo" className="img-fluid" />
190+
<img src="/tutorial/img/svg/static_website.svg" alt="logo" className="img-fluid" />
190191
</div>
191192
<div className="col-sm-6">
192193
<h2>Discover Your Powers</h2>

0 commit comments

Comments
 (0)