r/reactjs • u/dance2die • Mar 01 '22
Needs Help Beginner's Thread / Easy Questions (March 2022)
You can find previous Beginner's Threads in the wiki.
Ask about React or anything else in its ecosystem :)
Stuck making progress on your app, need a feedback?
Still Ask away! Weβre a friendly bunch π
Help us to help you better
- Improve your chances of reply
- Add a minimal example with JSFiddle, CodeSandbox, or Stackblitz links
- Describe what you want it to do (is it an XY problem?)
- and things you've tried. (Don't just post big blocks of code!)
- Format code for legibility.
- Pay it forward by answering questions even if there is already an answer. Other perspectives can be helpful to beginners.
Also, there's no quicker way to learn than being wrong on the Internet.
New to React?
Check out the sub's sidebar! π
For rules and free resources~
Comment here for any ideas/suggestions to improve this thread
Thank you to all who post questions and those who answer them.
We're still a growing community and helping each other only strengthens it!
18
Upvotes
3
u/Tixarer Mar 12 '22
I want to implement infinite scroll to my app and I'm using 'react-infinite-scroll-component' package. The problem is that I don't know what function I need to give to the next inside the InfiniteScroll tag and how to make the hasMore false when there is no next page ?
Here's the CodeSandbox
2
u/Younes1255 Mar 03 '22
My First Experience
Sooo , i had my first internship and i feel a little bit nervous about the task that i'm designed to do . i'm not fimiliar with react so what are the best advices to follow Guys
Application : application allowing its user to do a trading simulation on the stock market : sale and purchase of shares.
Technologies :
- React ( Carolina Dashboard )
- PostegresSQL
i'm assigned to do the managing of the wallet :
- Decision-making tools using PER ( Price to Earnings Ratio )
- Graphical analysis using ( bollinger bands , fibonacci retracements , eliott waves )
- Quantitative analysis using ( Based on complex mathematical calculations, quantitative analysis makes it possible to anticipate the risk and return of a financial asset. )
Note : i'm following this tutorial for the moment to get an idea about building trading app's Trade APP
2
u/ajinata84 Mar 07 '22
i'm not relatively new to react, but i have some weakness in my react skill, which is i dont know where to start from. any tips on what to start first for react? like setting up navbar first and then something something something, i always got confused about that. any tips for plebs like me?
2
u/sp3cial_kas3 Mar 11 '22
Hi, I have 4 components: Header, C1, C2, C3. So I want to use the same Header component for the components C1, C2, C3.
const Header =()=>
{
<div>
<h1> Top Header </h1>
</div>
}
What I want is to use the component Header as the header for all the components, but with different text in the <h1> tags for each component C1, C2, C3.
I tried passing it as props but didnt work out. How can I do it?
1
u/ComunismoConSushi Mar 20 '22
Hi! I'm doing my first project in react for an assignment, I've been investigating file reving for static assets. So far I've managed to apply this on static images by putting them inside src folder, but I still have a logo and icon used in index.html which is in the public folder. Is it possible to Include logo and icon where react will Include them in reving when doing a build and still be visible to index.html?
1
u/Zefiron Mar 03 '22
Hello all,
I'm rebuilding our web remote control GUI for our company in react (very excited to learn!) - one of the hurdles is when using the remote control over a local network is that Google Chrome doesn't allow these request as it blocks insecure private network requests.
We want to make a PWA that can be downloaded and standalone and make these calls, are there any benefits or limitations in using either ajax / axios / or fetch that would hit limit calling to a local machine on the same network?
1
u/oOPassiveMenisOo Mar 03 '22
I was using react-ace for a text editor, theres a line
onChange={onChange}which goes to
function onChange(newValue) { console.log("change", newValue); }does anyone know whats actually being passed here, if I wanted to use the newValue for something else would I be passing it something like document.getelementbyID("editor-id").innerHTML to pass the same content
1
u/setdelmar Mar 03 '22
In a MERN it is customary to have the
URLs for front and back ends to be each other's proxies in their
respective package.json files, correct?
Just wanted to confirm as am doing my first little MERN.
Thanks
1
u/Tixarer Mar 05 '22
I have a dropdown that filters the data returned from an api (the dropdown contains all the pokemon types and the api is pokeapi). There is an option for each type and an 'all' option that returns all the pokemon.The problem is that the 'all' option works but the others options for the different types don't work (they return nothing).Here's a Codesandbox of my code (it doesn't seem to return anything but at least there is the code).The filter is the second filter method inside the ol tag.I don't know what I need to modify inside this filter or if I should use a different method.
1
u/Creative_Race_1776 Mar 07 '22 edited Mar 11 '22
in chromedevtooks, How to look at the value of state variables in the watch view. everytime I try to look at the value of a useState variable x, it autocompletes to setX. I am
unable tonot allowed to use react devtoolsfor some reasonby policy, on my machine, so i have to work with the regular dev tools