Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Hussein Zaki
@Hussein90
i am really Stuck @all
Brad
@bradtaniguchi
@Hussein90 React is rendering your empty arrays. If you don't want that, then your code is working, just not doing what you want. You already know what you want, and know what is currently happening, that's like 80% of the problem, but now you need to go ahead and fix whats not working (the code you posted earlier "resets" the state).
Hussein Zaki
@Hussein90
so how to fix it
@bradtaniguchi
Mike Bilyeu
@mbilyeu1
Can anyone help me with the first data vis project? I can't get the two last test to pass. https://learn.freecodecamp.org/data-visualization/data-visualization-projects/visualize-data-with-a-bar-chart
Line 114 is what I have but doesn't pass? https://codepen.io/bilyeu1/pen/oajYgJ
Brad
@bradtaniguchi
@Hussein90 fix what?
Hussein Zaki
@Hussein90
the code you posted earlier "resets" the state)
that
Brad
@bradtaniguchi
You know whats wrong with it right?
Hussein Zaki
@Hussein90
i want the code to only remove one not all
Brad
@bradtaniguchi
so you want to remove something from an array?
Hussein Zaki
@Hussein90
yes
by click on delete button
Brad
@bradtaniguchi
If you don't know how to remove something from an array, look it up, and apply what you learn to your code
Hussein Zaki
@Hussein90
i see it but can't do it with my state
Brad
@bradtaniguchi
See what? And can't do what?
Hussein Zaki
@Hussein90
see how to remove from arry using splice()
don't know to access it in my component
@bradtaniguchi
Brad
@bradtaniguchi
Id recommend figuring out what you dont know and then figuring out how to find the answer
Hussein Zaki
@Hussein90
i know i will recommend that also but i didn't get at all
@bradtaniguchi
Brad
@bradtaniguchi
If you find yourself still stuck, then you might need to dig deeper or backup and re-evaluate what you actually don't know, since if "learning" the answer to something doesn't actually give you the answer, your probably looking at the wrong question, or missing other understanding of another concept.
If your not sure how to remove items from an array, then find that out, if your not sure how to update state in react, look that up, if your not sure how to remove an item from an array then update its reference in another item look that up, if your not sure what pass by "value vs pass by reference" then look it up, if your not sure how to use "splice" then look that up, etc etc..
Hussein Zaki
@Hussein90
you are right
i am sorry
that i am look dumb
but i am really didn't understand
@bradtaniguchi
Stevegolden12
@Stevegolden12
@Hussein90 We all make mistakes and we all need help at times. I personally appreciated the fact that you stuck with it.
Hussein Zaki
@Hussein90
and i am still stuck with it @Stevegolden12
Hussein Zaki
@Hussein90
@all i am still stuck can anyone help me
please
Claudio Restifo
@Marmiz
what's the matter?
Hussein Zaki
@Hussein90
i have problem with my delete button
@Marmiz
try to click on delete button
the first and then the second one
and then refresh do that vise versa
Claudio Restifo
@Marmiz
const dataposts = Object.assign([], this.state.data.posts);
what?
Hussein Zaki
@Hussein90
???
Claudio Restifo
@Marmiz
why do you want to allocate memory for a new object into an array?
Hussein Zaki
@Hussein90
i don't want
Claudio Restifo
@Marmiz
so what's that line
cos that's what that line is telling the program to fo
*do
Hussein Zaki
@Hussein90
okay
Claudio Restifo
@Marmiz

what are you tring to accomplish? Remove the clicked element?

if so why your delete set the state to an empty array?

Hussein Zaki
@Hussein90
yes
Claudio Restifo
@Marmiz
why your delete set the state to an empty array?