diff --git a/docs/react/_category_.json b/docs/_category_.json
similarity index 100%
rename from docs/react/_category_.json
rename to docs/_category_.json
diff --git a/docs/react/advanced-usage/_category_.json b/docs/advanced-usage/_category_.json
similarity index 100%
rename from docs/react/advanced-usage/_category_.json
rename to docs/advanced-usage/_category_.json
diff --git a/docs/react/advanced-usage/advanced-configuration.md b/docs/advanced-usage/advanced-configuration.md
similarity index 100%
rename from docs/react/advanced-usage/advanced-configuration.md
rename to docs/advanced-usage/advanced-configuration.md
diff --git a/docs/react/advanced-usage/alternatives-to-ejecting.md b/docs/advanced-usage/alternatives-to-ejecting.md
similarity index 100%
rename from docs/react/advanced-usage/alternatives-to-ejecting.md
rename to docs/advanced-usage/alternatives-to-ejecting.md
diff --git a/docs/react/advanced-usage/can-i-use-decorators.md b/docs/advanced-usage/can-i-use-decorators.md
similarity index 100%
rename from docs/react/advanced-usage/can-i-use-decorators.md
rename to docs/advanced-usage/can-i-use-decorators.md
diff --git a/docs/react/advanced-usage/custom-templates.md b/docs/advanced-usage/custom-templates.md
similarity index 100%
rename from docs/react/advanced-usage/custom-templates.md
rename to docs/advanced-usage/custom-templates.md
diff --git a/docs/react/advanced-usage/pre-rendering-into-static-html-files.md b/docs/advanced-usage/pre-rendering-into-static-html-files.md
similarity index 100%
rename from docs/react/advanced-usage/pre-rendering-into-static-html-files.md
rename to docs/advanced-usage/pre-rendering-into-static-html-files.md
diff --git a/docs/react/back-end-integration/DataFetcher.jsx b/docs/back-end-integration/DataFetcher.jsx
similarity index 100%
rename from docs/react/back-end-integration/DataFetcher.jsx
rename to docs/back-end-integration/DataFetcher.jsx
diff --git a/docs/react/back-end-integration/FetchDataComponent.jsx b/docs/back-end-integration/FetchDataComponent.jsx
similarity index 100%
rename from docs/react/back-end-integration/FetchDataComponent.jsx
rename to docs/back-end-integration/FetchDataComponent.jsx
diff --git a/docs/react/back-end-integration/_category_.json b/docs/back-end-integration/_category_.json
similarity index 100%
rename from docs/react/back-end-integration/_category_.json
rename to docs/back-end-integration/_category_.json
diff --git a/docs/react/back-end-integration/fetching-data-with-ajax-requests.md b/docs/back-end-integration/fetching-data-with-ajax-requests.md
similarity index 87%
rename from docs/react/back-end-integration/fetching-data-with-ajax-requests.md
rename to docs/back-end-integration/fetching-data-with-ajax-requests.md
index b6affc280..dca786136 100644
--- a/docs/react/back-end-integration/fetching-data-with-ajax-requests.md
+++ b/docs/back-end-integration/fetching-data-with-ajax-requests.md
@@ -144,6 +144,36 @@ const DataFetcher = () => {
export default DataFetcher;
```
+
+
+
Fetched Data
+
Fetching....
+
+
+
+
+
+
+
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.
### Step 4: Using the DataFetcher Component
diff --git a/docs/react/back-end-integration/integrating-with-an-api-backend.md b/docs/back-end-integration/integrating-with-an-api-backend.md
similarity index 71%
rename from docs/react/back-end-integration/integrating-with-an-api-backend.md
rename to docs/back-end-integration/integrating-with-an-api-backend.md
index 7532445ee..398b483c6 100644
--- a/docs/react/back-end-integration/integrating-with-an-api-backend.md
+++ b/docs/back-end-integration/integrating-with-an-api-backend.md
@@ -91,6 +91,32 @@ const App = () => {
export default App;
```
+
+
+
My React App
+
Fetching....
+
+
+
+
+
In this code, we use the `useState` and `useEffect` hooks from React to manage the state of the `posts` array. The `useEffect` hook makes an HTTP GET request to `/api/posts` when the component mounts. The response data is then used to update the `posts` state, and the list of posts is displayed in the app.
### Sending Data to the Backend
@@ -134,7 +160,7 @@ const App = () => {
Title: Sample Postbody: Hello Users, This is sample post create you own post
+
+
+
+
In this code, we added a form with inputs for the title and body of the post. When the form is submitted, the `handleSubmit` function is called, which captures the values of the form fields and sends a POST request to `/api/posts`. If the request is successful, the new post is added to the `posts` state, and the list is updated automatically.
## Conclusion
diff --git a/docs/react/back-end-integration/proxying-api-requests-in-development.md b/docs/back-end-integration/proxying-api-requests-in-development.md
similarity index 89%
rename from docs/react/back-end-integration/proxying-api-requests-in-development.md
rename to docs/back-end-integration/proxying-api-requests-in-development.md
index adb8ac3c2..bd8f0f1d6 100644
--- a/docs/react/back-end-integration/proxying-api-requests-in-development.md
+++ b/docs/back-end-integration/proxying-api-requests-in-development.md
@@ -160,6 +160,33 @@ function App() {
export default App;
```
+
+
+
Welcome to My React app
+
Fetching....
+
+
+
+
+
+
## "Invalid Host Header" Error and How to Handle It
In some cases, after configuring the proxy, you might encounter an "Invalid Host Header" error when developing remotely. This issue arises due to stricter host checks to prevent DNS rebinding attacks.
diff --git a/docs/react/back-end-integration/title-and-meta-tags.md b/docs/back-end-integration/title-and-meta-tags.md
similarity index 100%
rename from docs/react/back-end-integration/title-and-meta-tags.md
rename to docs/back-end-integration/title-and-meta-tags.md
diff --git a/docs/react/building-your-app/_category_.json b/docs/building-your-app/_category_.json
similarity index 100%
rename from docs/react/building-your-app/_category_.json
rename to docs/building-your-app/_category_.json
diff --git a/docs/react/building-your-app/adding-a-router.md b/docs/building-your-app/adding-a-router.md
similarity index 100%
rename from docs/react/building-your-app/adding-a-router.md
rename to docs/building-your-app/adding-a-router.md
diff --git a/docs/react/building-your-app/adding-bootstrap.md b/docs/building-your-app/adding-bootstrap.md
similarity index 100%
rename from docs/react/building-your-app/adding-bootstrap.md
rename to docs/building-your-app/adding-bootstrap.md
diff --git a/docs/react/building-your-app/adding-custom-environment-variables.md b/docs/building-your-app/adding-custom-environment-variables.md
similarity index 100%
rename from docs/react/building-your-app/adding-custom-environment-variables.md
rename to docs/building-your-app/adding-custom-environment-variables.md
diff --git a/docs/react/building-your-app/adding-flow.md b/docs/building-your-app/adding-flow.md
similarity index 100%
rename from docs/react/building-your-app/adding-flow.md
rename to docs/building-your-app/adding-flow.md
diff --git a/docs/react/building-your-app/adding-relay.md b/docs/building-your-app/adding-relay.md
similarity index 100%
rename from docs/react/building-your-app/adding-relay.md
rename to docs/building-your-app/adding-relay.md
diff --git a/docs/react/building-your-app/adding-typescript.md b/docs/building-your-app/adding-typescript.md
similarity index 100%
rename from docs/react/building-your-app/adding-typescript.md
rename to docs/building-your-app/adding-typescript.md
diff --git a/docs/react/building-your-app/importing-a-component.md b/docs/building-your-app/importing-a-component.md
similarity index 100%
rename from docs/react/building-your-app/importing-a-component.md
rename to docs/building-your-app/importing-a-component.md
diff --git a/docs/react/building-your-app/installing-a-dependency.md b/docs/building-your-app/installing-a-dependency.md
similarity index 100%
rename from docs/react/building-your-app/installing-a-dependency.md
rename to docs/building-your-app/installing-a-dependency.md
diff --git a/docs/react/building-your-app/making-a-progressive-web-app.md b/docs/building-your-app/making-a-progressive-web-app.md
similarity index 100%
rename from docs/react/building-your-app/making-a-progressive-web-app.md
rename to docs/building-your-app/making-a-progressive-web-app.md
diff --git a/docs/react/building-your-app/measuring-performance.md b/docs/building-your-app/measuring-performance.md
similarity index 100%
rename from docs/react/building-your-app/measuring-performance.md
rename to docs/building-your-app/measuring-performance.md
diff --git a/docs/react/building-your-app/production-build.md b/docs/building-your-app/production-build.md
similarity index 100%
rename from docs/react/building-your-app/production-build.md
rename to docs/building-your-app/production-build.md
diff --git a/docs/react/building-your-app/style.css b/docs/building-your-app/style.css
similarity index 100%
rename from docs/react/building-your-app/style.css
rename to docs/building-your-app/style.css
diff --git a/docs/react/building-your-app/using-global-variables.md b/docs/building-your-app/using-global-variables.md
similarity index 100%
rename from docs/react/building-your-app/using-global-variables.md
rename to docs/building-your-app/using-global-variables.md
diff --git a/docs/react/create-react-app.md b/docs/create-react-app.md
similarity index 100%
rename from docs/react/create-react-app.md
rename to docs/create-react-app.md
diff --git a/docs/react/css/style.css b/docs/css/style.css
similarity index 100%
rename from docs/react/css/style.css
rename to docs/css/style.css
diff --git a/docs/react/deployment/_category_.json b/docs/deployment/_category_.json
similarity index 100%
rename from docs/react/deployment/_category_.json
rename to docs/deployment/_category_.json
diff --git a/docs/react/deployment/deployment.md b/docs/deployment/deployment.md
similarity index 100%
rename from docs/react/deployment/deployment.md
rename to docs/deployment/deployment.md
diff --git a/docs/react/development/_category_.json b/docs/development/_category_.json
similarity index 100%
rename from docs/react/development/_category_.json
rename to docs/development/_category_.json
diff --git a/docs/react/development/analyzing-the-bundle-size.md b/docs/development/analyzing-the-bundle-size.md
similarity index 100%
rename from docs/react/development/analyzing-the-bundle-size.md
rename to docs/development/analyzing-the-bundle-size.md
diff --git a/docs/react/development/developing-components-in-isolation.md b/docs/development/developing-components-in-isolation.md
similarity index 100%
rename from docs/react/development/developing-components-in-isolation.md
rename to docs/development/developing-components-in-isolation.md
diff --git a/docs/react/development/setting-up-your-editor.md b/docs/development/setting-up-your-editor.md
similarity index 100%
rename from docs/react/development/setting-up-your-editor.md
rename to docs/development/setting-up-your-editor.md
diff --git a/docs/react/development/using-https-in-development.md b/docs/development/using-https-in-development.md
similarity index 100%
rename from docs/react/development/using-https-in-development.md
rename to docs/development/using-https-in-development.md
diff --git a/docs/react/getting-started/_category_.json b/docs/getting-started/_category_.json
similarity index 100%
rename from docs/react/getting-started/_category_.json
rename to docs/getting-started/_category_.json
diff --git a/docs/react/getting-started/available-scripts.md b/docs/getting-started/available-scripts.md
similarity index 100%
rename from docs/react/getting-started/available-scripts.md
rename to docs/getting-started/available-scripts.md
diff --git a/docs/react/getting-started/folder-structure.md b/docs/getting-started/folder-structure.md
similarity index 100%
rename from docs/react/getting-started/folder-structure.md
rename to docs/getting-started/folder-structure.md
diff --git a/docs/react/getting-started/forms-in-react.md b/docs/getting-started/forms-in-react.md
similarity index 86%
rename from docs/react/getting-started/forms-in-react.md
rename to docs/getting-started/forms-in-react.md
index f08c598d7..2aa9021ad 100644
--- a/docs/react/getting-started/forms-in-react.md
+++ b/docs/getting-started/forms-in-react.md
@@ -24,6 +24,13 @@ const root = ReactDOM.createRoot(document.getElementById('root'));
root.render();
```
+
+
+
+
This will work as normal, the form will submit and the page will refresh.
But this is generally not what we want to happen in React.
@@ -68,6 +75,13 @@ const root = ReactDOM.createRoot(document.getElementById('root'));
root.render();
```
+
+
+
+
## Forms
These docs are old and won’t be updated. Go to react.dev for the new React docs.
@@ -133,6 +147,19 @@ class NameForm extends React.Component {
}
```
+
+
+
+
Since the `value` attribute is set on our form element, the displayed value will always be `this.state.value`, making the React state the source of truth. Since `handleChange` runs on every keystroke to update the React state, the displayed value will update as the user types.
With a controlled component, the input’s value is always driven by the React state. While this means you have to type a bit more code, you can now pass the value to other UI elements too or reset it from other event handlers.
@@ -183,6 +210,20 @@ class EssayForm extends React.Component {
}
}
```
+
+
+
Notice that `this.state.value` is initialized in the constructor so that the text area starts off with some text in it.
@@ -239,6 +280,26 @@ class FlavorForm extends React.Component {
}
```
+
+
+
+
Overall, this makes it so that ``, `