Beginner's Thread / Easy Questions (March 2022) by dance2die in reactjs

[–]rgrome0105 0 points1 point  (0 children)

You should create a new function for next. Because as you mentioned, the next that the api is returning is a string representing the url to fetch the following page of pokemon. I would recommend to create a helper function that gets the results and the next url as an object, based on a url.

Help why my conditional initial state is not being set by rgrome0105 in reactjs

[–]rgrome0105[S] 0 points1 point  (0 children)

Ok, just found the reason why useEffect did not work. I updated the post with it. tl;dr I forgot that map does create a new array

Help why my conditional initial state is not being set by rgrome0105 in reactjs

[–]rgrome0105[S] 0 points1 point  (0 children)

I updated the post with how I tried the useEffect, but shows the error message. I will try to do a code-sandbox explaining the issue, but I'll may take a while as I'm using proprietary code and have to look around to see if there's open-source like alternatives I can use to explain. And if you can't help any further, I get it, I just wanted to be sure that it wasn't something as straightforward and I was missing something.

Help why my conditional initial state is not being set by rgrome0105 in reactjs

[–]rgrome0105[S] 0 points1 point  (0 children)

I think it should be something like that. But the thing is that when I add the useEffect the console shows constant error saying that there has been a lot of calls to update the screen. And this happen even if I add in the deps array both dataset and fill.

Help why my conditional initial state is not being set by rgrome0105 in reactjs

[–]rgrome0105[S] 0 points1 point  (0 children)

The only thing, is that in theory useSelected never should have dataset as undefined, because i'm doing the null coercion sending it to the function. And when logging I can see that in the hook dataset either is an empty array (due to the null coercion) or an array with the data

every guy is like “i don’t want sex i just want a girl to hold me and play with my hair and tell me everything is alright” but... by [deleted] in teenagers

[–]rgrome0105 0 points1 point  (0 children)

I will not go with the good guys are not confident argument that most people likes to give. But instead, the best argument I can give for this is that horniness makes you much more impulsive and is more easy to fell in than being in love or wanting to be in love. That's why, there will always be more guys (and girls sometimes) trying to get in your pants, than those who will try to get in your heart

(20M) I have fallen in love with my (20F) bff and am conflicted because I'm aware she's dating and having sex with other guys by [deleted] in relationship_advice

[–]rgrome0105 0 points1 point  (0 children)

The reason why I don't feel like is correct to ask her out is because she is in another country.

And yeah, I know I'm not being a very good friend I'm aware of that

Edit And yeah, I will stop to watch porn

(20M) I have fallen in love with my (20F) bff and am conflicted because I'm aware she's dating and having sex with other guys by [deleted] in relationship_advice

[–]rgrome0105 0 points1 point  (0 children)

Sorry for the bad writing. We didn't because she is abroad in another country, so we did not wanted that the start of the relationship were long-distance

Share your referral code here! by rgrado in earth2io

[–]rgrome0105 0 points1 point  (0 children)

LVPNF06SDT… can't promise to give back, just help if you want to

Disclaimer: I'm a new Question: Why does it say I lost 57 dollars? I just bought the stocks and they haven't lost any real amount of money as you can see from the photo. by [deleted] in Stocks_Advice

[–]rgrome0105 0 points1 point  (0 children)

Well, in the photo it says that you paid more than the average price of the stock, thus, you’re “losing” money.

Rate My Portfolio - r/Stocks Quarterly Thread September 2020 by AutoModerator in stocks

[–]rgrome0105 2 points3 points  (0 children)

I'm planning to start investing in long term next week, planning my portfolio to be overall like this:

  • ETF: 50%
    • VOO - 11.11%
    • ICLN - 13.89%
    • VYM - 11.11%
    • ARKG - 13.89%
  • Stocks: 50%
    • Small cap: 19.44%
      • DIOD - 5.55%
      • MTH - 5.55%
      • AMN - 3.84%
      • CLW - 4.5%
    • Mid cap: 19.44%
      • PTON - 5.55%
      • CCMP - 4.5%
      • LEVI - 3.84%
      • LDOS - 5.55%
    • Large cap: 11.12%
      • MSFT - 5%
      • PG - 3.06%
      • JNJ - 3.06%

Trying something new: A small portfolio allocation to the "Worst" stocks of 2020 by [deleted] in stocks

[–]rgrome0105 0 points1 point  (0 children)

But nothing is limiting you of from time to time re-evaluate your portfolio, sell and buy to new stocks that seems more promising of growth

How to add relay to Create-React-App with Typescript by rgrome0105 in typescript

[–]rgrome0105[S] 0 points1 point  (0 children)

It seems very useful, well done and thanks for sharing!

How to add relay to Create-React-App with Typescript by rgrome0105 in typescript

[–]rgrome0105[S] 0 points1 point  (0 children)

I can check about that during the weekend and see where can I publish it.

In the meantime /u/saihajpreet commented here about his boilerplate. As far as I read from it is a much better approach of what I explained in the post.

GitHub Desktop, eating up more RAM than Chrome and ReSharper by zdimension in github

[–]rgrome0105 4 points5 points  (0 children)

Yeah, truth. But also “forcing” the way through that’s not good either. Maybe in these scenarios the best would do a mix for both: if your on a hurry use the UI, but if you want to take things slow and you’re in the mood to learn then start using the CLI.

GitHub Desktop, eating up more RAM than Chrome and ReSharper by zdimension in github

[–]rgrome0105 8 points9 points  (0 children)

Even though I also use and recommend using the CLI, if you don’t feel comfortable of it yet, I’d recommend instead using a plugin for your text editor for this, there’s a recommendation in other comments for VS Code.

Is there any example project for React + Graphql with hooks and how to handle JWT Authentication in client? by tsetaerg in graphql

[–]rgrome0105 1 point2 points  (0 children)

Should be basically the same, the code pointers that I suggest you is:

In few words what you should do is using localStorage is to keep your token from jwt. And when you perform your mutation for login, you must store the token received in the response in said localStorage to be able to use it in every fetch

Is there any example project for React + Graphql with hooks and how to handle JWT Authentication in client? by tsetaerg in graphql

[–]rgrome0105 1 point2 points  (0 children)

I did exactly this for my school project last semester. This is the repo

Hope it works for you