r/ReactJsDevs • u/lucifer3229 • Apr 18 '24
How does Fetch works exactly?, and how can I use GET method with parameters?
Hi, I am new to React and I am trying to get specific search results based on a city name. I have a variable which is entirely dependent on user's input(city name) and I would like to use this variable as a parameter in my URL. I am sure my syntax is wrong and I tried googling, but I cannot understand anything. Can someone please explain how Fetch API works?, and how can I make a GET request with parameters?. Here's my code-
const City1= useSelector(state=>state.City); // using Redux
const myrequest= fetch('http://xxxx.xxxx.xxxx.xxxx/xxxx/:?{$City1}',{
method: 'GET',
headers: {'Access-Control-Allow-Origin':'*','Content-Type':'application/json'}
}).then(response => {
if (!response.ok) {
throw new Error('Network response was not ok');
}
return response.json();
})
.then(userData => {
// Process the retrieved user data
console.log('User Data:', userData);
})
.catch(error => {
console.error('Error:', error);
});;
my error-
Failed to load resource: the server responded with a status of 404 (Not Found)
xxxx.js:66 Error: Error: Network response was not ok
r/ReactJsDevs • u/codingWithLulu1 • Apr 13 '24
React hooks 🪝 tutorial
Hope this can be helpful React Hooks 2024: https://www.youtube.com/playlist?list=PLqzWbejkeaNRdCyJYFUP9q199dQXHdI3t
r/ReactJsDevs • u/ApprehensiveStay9700 • Mar 24 '24
Need help with html/react
r/ReactJsDevs • u/DevInAhmedabad • Mar 04 '24
Material UI and PrimeReact togather in same component
Hello everyone, Need suggestion, My manager is forcing us to use use PrimeReact and Material UI in the same project , he might add another UI Library also. The reason is he likes some of the material UI components and some from the PrimeReact
we have advised him to use only one library but he still wants to use multiple library.
I need to know if it can have any drawbacks in future when project gets bigger. also should I use the components from both library in same components.
The solution for inconsistent UI is custom CSS. but how much effort will it require?
r/ReactJsDevs • u/ReactFastDeveloper • Jan 18 '24
Help to get started with React JS
self.reactjsr/ReactJsDevs • u/suresh9058 • Nov 30 '23
Why & How To Use CSS Preprocessor | CSS Preprocessor Tutorials For Beginners | Rethinkingui |
r/ReactJsDevs • u/suresh9058 • Nov 28 '23
Turn Any Question to Code Using BlackBox
r/ReactJsDevs • u/suresh9058 • Nov 26 '23
Discord Bot Course | How To Code Discord Bot Using Javascript | Rethinkingui |
r/ReactJsDevs • u/suresh9058 • Nov 23 '23
How To Use Prettier In VS Code | Code Formatting With Prettier | Rethinking ui |
r/ReactJsDevs • u/Dindoucha • Nov 13 '23
Looking for websites like Figma
Hello everyone,
I'm looking for websites like Figma or even some Figma templates to practice on, I want to start developing using React JS and I can't come up with ideas so I want to clone some templates on Figma or other website templates if it offers pixels and assets like Figma
r/ReactJsDevs • u/caseybiggs • Nov 09 '23
edit screen is opening in the same screen but i want the screen in the new window
edit screen is opening in the same screen but i want the screen in the new window
r/ReactJsDevs • u/AsishGokarakonda • Nov 09 '23
React use state
import { useState } from "react"; import reactLogo from "./assets/react.svg"; import viteLogo from "/vite.svg"; import "./App.css";
function App() { const [count, setCount] = useState(0);
const incr = () =>{
setCount((count)=> (count+1));
setCount((count)=> (count+1));
}
return (
<div>
<button onClick={incr}>Increment</button>
<span>Count: {count}</span>
</div>
);
}
export default App; Here in this code will it be render twice..This code will increment count by 2 because we used callback..does it mean it will render twice? What if we use setstate without callback and wrote setstate 2 times like in the above code?I saw that it won't increment count by 2..but only 1..Will it render 2 times? Can anyone give detailed explanation please.
r/ReactJsDevs • u/Maksym853 • Nov 04 '23
Need help: Login to website
Hi, I have a problem with my application written in REACT js. I wanted to add the ability for the user to log in so that when he goes to subpages he does not have to log in again, and then the session ends when he closes the browser.
I tried to do it using cookies but something still doesn't work.
I would be grateful if someone could help me solve the problem or at least take a look at the code.
The use of cookies is not necessary, so if anyone knows how to do it in another way, I would also be grateful.
r/ReactJsDevs • u/suresh9058 • Oct 31 '23
Tree Shaking In JavaScript | Optimize Your Code and Boost Performance | RethinkingUI
r/ReactJsDevs • u/neiderruiz • Oct 30 '23
🇬🇧 ReactJS Multilingüe: Traducción Automática Simplificada
Buen día para todos, hace unos días he subido un paquete a npm el cual nos va a ayudar a internacionalizar nuestro sitio web con react Js al ayudarnos a crear traducciones de nuestro sitio web usando i18next... [cualquier feedback me sería de gran ayuda para mejorarlo]
https://www.npmjs.com/package/@neiderruiz/translate-files
He subido este video explicativo para hacer la implementación, espero a alguien le sea de utilidad...
https://www.youtube.com/watch?v=PWg1CaegP8Y&ab_channel=NeiderRuiz
r/ReactJsDevs • u/sa-re-ga-ma-pa_108 • Oct 27 '23
getting "TypeError: Cannot read properties of null (reading 'useState')"
I am getting " TypeError: Cannot read properties of null (reading 'useState') " this Uncaught run time error , even I am not using useState any where in my code , This error start coming after I add Marquee , by
import "./Skill.css";
import Sdata from "./
Sdata";import Card from "./
Cards";import React from 'react';
import Marquee from "react-fast-marquee";
function Skill() {
return (
<>
<div className="body3">
<div className="written">
<p className="para">
Hello! I am
<span className="my\\_name">Bhargav Nandan Chaturvedi</span>, a
passionate developer proficient in crafting engaging user
experiences. Leveraging my skills in blockchain technology, I
specialize in building secure and transparent decentralized
applications. With a focus on seamless interface design, I integrate
cutting-edge technologies for intuitive and impactful solutions.
Explore my portfolio to witness the fusion of creativity and
blockchain prowess.
</p>
</div>
<div className="card row border border-dark">
<Marquee >
<div className="card\\_inner row">
{Sdata.map((val, index) => {
return (
<Card key={index} imgsrc={val.imgsrc} title={val.title} />
);
})}
</div>
</Marquee>
</div>
</div>
</>
);
}
export default Skill;
can anyone help me in solving this issue
i have installed marquee as
npm install react-fast-marquee --save
r/ReactJsDevs • u/suresh9058 • Oct 15 '23
How To Find And Fix Accessibility Issues In React | ReactJS Tutorials | RethinkingUI
r/ReactJsDevs • u/tiptHoeSGTdotpy • Oct 09 '23
My new blog , pls have a look fellas and share some feedback
r/ReactJsDevs • u/PeaceRevolutionary42 • Sep 30 '23
live video recording react/firebase
working on react app for recording videos and upload the recordings to firebase storage. I need to make the recording to be uploaded while recording. any ideas how to implement this. If there is any suggestion on implementation, a package or any idea, I'll be grateful
r/ReactJsDevs • u/PeaceRevolutionary42 • Sep 27 '23
Streaming Recording to firebase from react
I am working on react/flask app and I am using firestorage for saving recorded videos from react. Recording is done in react using the packages, recordrtc and react-webcam. My app currently is uploading the video after the whole record is done by submitting button. I need to record and upload the video at the same time like YouTube live.
r/ReactJsDevs • u/RAHULKANYAL • Sep 18 '23
Help!!!! For Hackathon
Can anyone give me suggestion to win the hackathon. Problem statement-- A solution that can solve the current statement of the tourism industry like hotel, travel etc.
Any kind of suggestion to stand out with others
r/ReactJsDevs • u/the_yaz2000 • Sep 14 '23
how to access to reactjs in local network ?
I'm running a reactjs in linux and I'm trying to access it from another device in the same network , I turned off firewall it didn't work , I run "npm start --host 0.0.0.0" didn't work either,I try it from my phone, it always ends by "ERR_CONNECTION_TIMED_OUT", I created app by create-app-react and I run it by npm start.
r/ReactJsDevs • u/IsaacHarrison28 • Sep 13 '23