These are chat archives for FreeCodeCamp/HelpJavaScript

9th
Apr 2018
Ryan Williams
@Ryanwfile
Apr 09 2018 02:29

I am trying to create an array of objects and then map through the array creating a new rectangle for each object. I'm using react and so far the code I have is

class Card extends React.Component {
  render()
  {    
   const cards = [{name: "Beast", description:"xyz"},{name: "Beast2", description:"xyz2"}];
    return (
      <div className = "rect">
        {
            cards.map(card =>{
              return  (
                <div key = {card.name}>
                  <div className = "cardName">
                    <h2 >{card.name}</h2> 
                  </div>                             
                </div>
              );                        
            })
          }        
      </div>     
    )
  }
}

but this is mapping each object to the same rectangle not creating a new rectangle. Any help is greatly appreciated.

Stephen James
@sjames1958gm
Apr 09 2018 02:36
@Ryanwfile If you need more than one rect then className="rect" needs to be inside the map as well
Ryan Williams
@Ryanwfile
Apr 09 2018 02:37
@sjames1958gm Thank you so much I will try that
CamperBot
@camperbot
Apr 09 2018 02:37
ryanwfile sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 9183 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Stephen James
@sjames1958gm
Apr 09 2018 02:38
@Ryanwfile :+1: gl
anthonygallina1
@anthonygallina1
Apr 09 2018 04:51
yello
MaxQvO
@MaxQvO
Apr 09 2018 08:34
Escaping Literal Quotes in Strings
Stephen James
@sjames1958gm
Apr 09 2018 10:10
@MaxQvO Did you solve it?
AbrisM
@AbrisM
Apr 09 2018 14:33
Has anyone gotten a cannot overide abstract error?
Jason Luboff
@JLuboff
Apr 09 2018 15:09
Morning
Danny Chan
@chandanny
Apr 09 2018 15:41
@JLuboff hello
@chandanny
is it matter if i don't know how to use webpack?
is it good to learn webpack right now?
Ronique Ricketts
@RoniqueRicketts
Apr 09 2018 16:14
Hello everyone
Kudzu
@czhower
Apr 09 2018 16:19
hello
Ronique Ricketts
@RoniqueRicketts
Apr 09 2018 16:19
Hey new mentor
I wanted to know if we are using managed stated in Reactjs can we use it to handle image upload and if so how do we save it in state?
Jason Luboff
@JLuboff
Apr 09 2018 16:22
@RoniqueRicketts Morning
Ronique Ricketts
@RoniqueRicketts
Apr 09 2018 16:23
@JLuboff morning bruv
Danny Chan
@chandanny
Apr 09 2018 16:24
Good evening
Jason Luboff
@JLuboff
Apr 09 2018 16:25
Whats good
Ronique Ricketts
@RoniqueRicketts
Apr 09 2018 16:26
Whats up man
Danny Chan
@chandanny
Apr 09 2018 16:26
You can get data from callback function and save it to react state. The render will automatically run again and draw the image
Ronique Ricketts
@RoniqueRicketts
Apr 09 2018 16:27
@chandanny so in my input i have a type of file so it will allow me to browse to the image how do I load that in my react state.
Danny Chan
@chandanny
Apr 09 2018 16:33
Submit form call the function with your input as parameter. In function, use setstate() to store data into react state
Jason Luboff
@JLuboff
Apr 09 2018 16:34
@RoniqueRicketts Just staying busy at work..you
Ronique Ricketts
@RoniqueRicketts
Apr 09 2018 16:37
@JLuboff here at work, remote on my computer at home trying to set up a form on my personal app. :)
Jason Luboff
@JLuboff
Apr 09 2018 16:37
@RoniqueRicketts Cool :D
Ronique Ricketts
@RoniqueRicketts
Apr 09 2018 16:53
I am checking out something then back to code
Brad
@bradtaniguchi
Apr 09 2018 17:47
hi all
Jason Luboff
@JLuboff
Apr 09 2018 17:49
:wave:
Ronique Ricketts
@RoniqueRicketts
Apr 09 2018 18:19
hail
Henry
@GitHub-Henry
Apr 09 2018 18:26
@JLuboff :wave: I found something that might interest you, Edge.js
Jason Luboff
@JLuboff
Apr 09 2018 18:28
@GitHub-Henry Interesting... so it lets you run C#/.NET within a node app?
Henry
@GitHub-Henry
Apr 09 2018 18:28
Edge.js connects .Net, C#, TSQL and other things to Node.JS
I was just reading what it can do. I didn't read how to do it
Jason Luboff
@JLuboff
Apr 09 2018 18:29
@GitHub-Henry Thanks. I'm going to have to read more into it. Might be quite useful for me
CamperBot
@camperbot
Apr 09 2018 18:29
jluboff sends brownie points to @github-henry :sparkles: :thumbsup: :sparkles:
:cookie: 540 | @github-henry |http://www.freecodecamp.org/github-henry
Henry
@GitHub-Henry
Apr 09 2018 18:30
np, let me know how it works for you
Jason Luboff
@JLuboff
Apr 09 2018 18:31
For sure :+1:
JJ Megma
@megma_jj_twitter
Apr 09 2018 19:23
Anyone here?
Randell Dawson
@RandellDawson
Apr 09 2018 19:42
@megma_jj_twitter - How can we help you?
Lance
@texas2010
Apr 09 2018 19:42
do anyone use yarn?
i got error after i trying to install yarn though npm. O_o
JJ Megma
@megma_jj_twitter
Apr 09 2018 19:44
@randelldawson No I am here to help
@texas2010 What is the error?
Lance
@texas2010
Apr 09 2018 19:45
i would post it but it is too long error. lol so i will skip some error
my-mac-mini:~ texas2010$ npm install -g yarn
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Please try running this command again as root/Administrator.
it seems i have to use sudo for that
JJ Megma
@megma_jj_twitter
Apr 09 2018 19:48
@texas2010 Are you just trying to install yarn?
Lance
@texas2010
Apr 09 2018 19:48
yes
JJ Megma
@megma_jj_twitter
Apr 09 2018 19:49
brew install yarn
Lance
@texas2010
Apr 09 2018 19:49
okay
JJ Megma
@megma_jj_twitter
Apr 09 2018 19:50
Did that work?
Lance
@texas2010
Apr 09 2018 19:51
i dont have brew. ugh.
JJ Megma
@megma_jj_twitter
Apr 09 2018 19:51
Oh
wait...
Lance
@texas2010
Apr 09 2018 19:53
i didnt do anything now. i am looking at Q&A . i am doing react course at udemy lol
JJ Megma
@megma_jj_twitter
Apr 09 2018 19:53
Is that a good React course?
Lance
@texas2010
Apr 09 2018 19:54
yeah. this course
it seems i have to use sudo for that. lol
@megma_jj_twitter thanks
CamperBot
@camperbot
Apr 09 2018 19:56
texas2010 sends brownie points to @megma_jj_twitter :sparkles: :thumbsup: :sparkles:
api offline
Lance
@texas2010
Apr 09 2018 19:57
@megma_jj_twitter i forget to post link. here link https://www.udemy.com/react-2nd-edition/learn/v4/overview
Christopher McCormack
@cmccormack
Apr 09 2018 20:12
:wave:
Jason Luboff
@JLuboff
Apr 09 2018 20:15
@cmccormack :wave:
Christopher McCormack
@cmccormack
Apr 09 2018 20:15
@JLuboff what's up man? Have a good weekend?
Jason Luboff
@JLuboff
Apr 09 2018 20:16
@cmccormack Just got back from lunch. Weekend was not too bad. Didn't do a ton which is okay, sometimes thats all you need. You?
Christopher McCormack
@cmccormack
Apr 09 2018 20:17
Great weekend, lots of coding got done!
Markus Kiili
@Masd925
Apr 09 2018 20:17
Evening.
Jason Luboff
@JLuboff
Apr 09 2018 20:18
@cmccormack Nice...Voting app?
@Masd925 Hey
Christopher McCormack
@cmccormack
Apr 09 2018 20:18
yeah still on that one
almost done now though!
Jason Luboff
@JLuboff
Apr 09 2018 20:18
Awesome
That one took me a while.. but since then... I've learned many of the mistakes I made with it lol
Markus Kiili
@Masd925
Apr 09 2018 20:19
@JLuboff National championships wen't well. I won the static apnea with 6min 5sec breath hold.
Christopher McCormack
@cmccormack
Apr 09 2018 20:20
@JLuboff yeah hoping the next few fly by
Jason Luboff
@JLuboff
Apr 09 2018 20:20
@Masd925 Good job! So whats next? World Championship?
@cmccormack Nightlife and stock chart aren't too bad. Stock chart maybe a little more difficult only becuase of the need for socket.io. Book trader took me the longest. Pinterest clone was eh..
Markus Kiili
@Masd925
Apr 09 2018 20:21
@JLuboff Not sure about that. They will set the qualification levels soon and they will look at the best results of last two years. It will be close I think.
World championships are in June in Belgrad if I remember correctly.
Jason Luboff
@JLuboff
Apr 09 2018 20:24
For something like that, do you look to get sponsors? Or do you just pay for everything out of pocket?
Markus Kiili
@Masd925
Apr 09 2018 20:25
@JLuboff I think it is mostly from own pocket. Never been to any international competitions, so not sure.
Jason Luboff
@JLuboff
Apr 09 2018 20:34
@Masd925 Well if you need a sponsor, I'll through $5 your way, but I demand that my logo be present on your goggles
Markus Kiili
@Masd925
Apr 09 2018 20:36
@JLuboff ok. I will take that under consideration. Nice to have a sponsor.
Brad
@bradtaniguchi
Apr 09 2018 21:27
man I don't understand how come people message me to tell me about bugs when we have a freaken bug tracking system :/ and when they DO tell me I copy-paste their issue into it -_-
Jason Luboff
@JLuboff
Apr 09 2018 21:54
@bradtaniguchi Soi you reply to them "Please route this message to the bug tracking system, I am unable to process bugs that are not put through the system"
Brad
@bradtaniguchi
Apr 09 2018 21:54
So if the people are on my own team, I can say this more harshly right :P
Jason Luboff
@JLuboff
Apr 09 2018 21:55
Yup!