These are chat archives for FreeCodeCamp/Help

24th
Mar 2018
Norvin Burrus
@ndburrus
Mar 24 2018 00:10
@dkapexhiu you're welcome, sir! enjoy :+1:
Andrew
@A-coding116
Mar 24 2018 02:10
Hey i have a question to anyone about C#- does it matter to learn the newest version of it because i found a great book but its from 2012?
Eric Miller
@ericmiller777
Mar 24 2018 03:21
@thekholm80 it works, thank you
CamperBot
@camperbot
Mar 24 2018 03:21
ericmiller777 sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1740 | @thekholm80 |http://www.freecodecamp.org/thekholm80
Kyle Holm
@thekholm80
Mar 24 2018 03:24
@ericmiller777 the redux? good deal
it's a pain in the butt, but it makes so many things so much easier
Apollo
@enigmacipher
Mar 24 2018 06:17
thanks @gulsvi
CamperBot
@camperbot
Mar 24 2018 06:17
enigmacipher sends brownie points to @gulsvi :sparkles: :thumbsup: :sparkles:
:star2: 2686 | @gulsvi |http://www.freecodecamp.org/gulsvi
Stephen James
@sjames1958gm
Mar 24 2018 13:15
@A-coding116 If you are just starting out with c# then an older book should be ok.
But you probably need to be aware of any new features as you go along.
Aditya
@ezioda004
Mar 24 2018 13:17
Hello /help,
I have a noob React question.
Say I have a Child component whose data I'm passing to Parent with a callback function that only triggers when there's a change in Child component. So when the page loads it renders and I have set some initial value to this Child. Is there a way to pass this initial value to Parent component? I'm thinking componentWillMount() can be used here since I only need this value once? or is there another way?
Claudio Restifo
@Marmiz
Mar 24 2018 13:20

@ezioda004 what you are doing is pretty much "against" the best practice of react.
In theory the flow of data should always go from parent to child.

If you realise some data is required to the parent as well, simply lift the sate up one level (eg: move it to the parent)
and pass it to che Child as prop.
It's way less hassle.

@ezioda004 in theory you can do it with lifecycle and so on, but it's just more complicated for no reason
Aditya
@ezioda004
Mar 24 2018 13:23
@Marmiz So I have a parent with 2 children, I'm passing the data as prop from 1 child and storing it to parent's state and then passing it to another child to display that data. Is that a bad design? If so how should I change it?
Claudio Restifo
@Marmiz
Mar 24 2018 13:24
@ezioda004 Is it Parent -> Children -> GrandChildren
or Parent --> Children Children?
Aditya
@ezioda004
Mar 24 2018 13:25
Parent -> Children1
Parent -> Children2
Claudio Restifo
@Marmiz
Mar 24 2018 13:25

'm passing the data as prop from 1 child

this is weird. Only a parent can pass props to a children. A children can never pass a prop to a parent in React

Aditya
@ezioda004
Mar 24 2018 13:26
No no, thats a callback function that triggers from parent when there's a change in the child and it changes parents state.
Claudio Restifo
@Marmiz
Mar 24 2018 13:27
That's ok, but it's way different than a child passing data. Logically the parent holds both the data and the methods to update that data.
The Child just "inform" the parent that something has happened
Stephen James
@sjames1958gm
Mar 24 2018 13:27
@ezioda004 You are passing data through a function that you provide as a prop?
That is probably not a bad design for isolated cases
Claudio Restifo
@Marmiz
Mar 24 2018 13:27
This is how it's supposed to be
Stephen James
@sjames1958gm
Mar 24 2018 13:28
@ezioda004 When you start getting larger, you may want to consider Redux for a central repository for state.
Aditya
@ezioda004
Mar 24 2018 13:29
@Marmiz Yes exactly
@sjames1958gm I'll try to make a pen to explain exactly and I'm learning Redux but this is just for markdown previewer so I reckon Redux shouldnt be required for this
Stephen James
@sjames1958gm
Mar 24 2018 13:29
@ezioda004 I did the same for my markdown previewer. The input side reported change to the parent who passed it down to the markdown side.
@ezioda004 This seems perfectly fine for this project
Claudio Restifo
@Marmiz
Mar 24 2018 13:32

@ezioda004 in theory the flow is:

class Parent = {
  state = { data}

  onSomethingHappens = () => the data changes

  return() {
   <A data={this.state.data} onSomethingHappens={this.onSomethingHappens} />
   <B data={this.state.data} />
  }
}

So that both A and B (and Parent) will be in sync with data, but as you can see only in A we pass the methods thus only in A we can change the data.
Make sense?

@ezioda004 Also personal opinion.
Wait to learn Redux. Just makes thing less easier to understeand.

Get React first. Then when you'll realise your state is getting too difficult to maintain go for a store (redux, MobX...)

You should be confortable in doing stuff like this anytime before considering a store manager
Aditya
@ezioda004
Mar 24 2018 13:36
@Marmiz @sjames1958gm ^ Yes, in theory this is what I have. My question is how can I get the initial set value in the Child to Parent before rendering so I can show that to other child.
Say I have set <textarea> Hello world <textarea> and I want it to be displayed on another child without triggering the callback function.
Stephen James
@sjames1958gm
Mar 24 2018 13:37
@ezioda004 The initial state should come from the parent not from teh child
Aditya
@ezioda004
Mar 24 2018 13:37
@Marmiz Ah, but meanwhile I wanna do some projects/hands on cause I feel like Im doing too much theory and no practical
Claudio Restifo
@Marmiz
Mar 24 2018 13:38
@ezioda004 as @sjames1958gm (said), if that information is useful not only for the child, you should move it to the first Parent all the components have in common
^all the Child components
Aditya
@ezioda004
Mar 24 2018 13:38
So should I store that in some variable and pass it to the children from parent?
Stephen James
@sjames1958gm
Mar 24 2018 13:39
@ezioda004 Store that is your parent state as the initial state, which you pass to both children who process / present it
Claudio Restifo
@Marmiz
Mar 24 2018 13:40
parent {
 state= {text: 'i am the initial text' }

  onchange = (newText) => changeState.to.newText

 <Child text={this.state.text} onChange={this.onChange} />
}
The children only display the data, the parents holds the methods :)
Stephen James
@sjames1958gm
Mar 24 2018 13:41
@Marmiz :+1:
Claudio Restifo
@Marmiz
Mar 24 2018 13:41
@sjames1958gm :fire: :sparkles:
Aditya
@ezioda004
Mar 24 2018 13:42
@Marmiz @sjames1958gm Awesome, I had it backwards. Thanks
One last question, so doing the other way around is a bad idea because React's data binding is one way?
CamperBot
@camperbot
Mar 24 2018 13:42
ezioda004 sends brownie points to @marmiz and @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 1192 | @marmiz |http://www.freecodecamp.org/marmiz
:star2: 9130 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
Nazar
@IsaakNazar
Mar 24 2018 14:28
hey everybody
Phoebe
@pl98
Mar 24 2018 14:38
Hi guys! First time posting here, I'm working on the portfolio project and I'm having a lot of trouble with input fields. Hopefully I'm not being dumb! 😛I'm trying to implement a contact form with three input fields. I want two for "name" and "email" next to each other on one row, then one for "message" on the next row. I want the message one to be the same width as the other two combined so it lines up nicely. Right now there's this weird space between the name and email fields and I can't get them to go away!
Stephen James
@sjames1958gm
Mar 24 2018 14:48
@pl98 Do you have this online somewhere? So we can look?
@IsaakNazar :wave:
Nazar
@IsaakNazar
Mar 24 2018 14:51
@sjames1958gm :wave: :smile:
Stephen James
@sjames1958gm
Mar 24 2018 14:53
@pl98 so bootstrap is giving you 15px padding left/right for your columns
Phoebe
@pl98
Mar 24 2018 14:55
wait what does that mean?
Stephen James
@sjames1958gm
Mar 24 2018 14:56
@pl98 https://stackoverflow.com/questions/19562903/remove-padding-from-columns-in-bootstrap-3
It means that col-* styles automatically provide padding which is space inside the columns but outside your input elements.
Apollo
@enigmacipher
Mar 24 2018 14:58
when styling <img> with min-width: 100px; max-width:470px; , I have to add width: 100%; or the img won't change as I resize the window. But with <p>, width:100%; isnt needed. Why is that?
Phoebe
@pl98
Mar 24 2018 15:00
If I remove the padding by creating the nopadding class, how do I center the input fields again?
Stephen James
@sjames1958gm
Mar 24 2018 15:24
@pl98 If you only apply that to the columns around the name and email - they should stay centered?
Phoebe
@pl98
Mar 24 2018 15:25
I figured it out! I had to remove the margin styler :)
Amit Patel
@AmitP88
Mar 24 2018 15:39

hey all, what do you think of my pomodoro timer so far? It's still a work in progress, but here's a demo

https://amitp88.github.io/Pomodoro-Timer/

Stephen James
@sjames1958gm
Mar 24 2018 15:52
@pl98 :+1:
Nazar
@IsaakNazar
Mar 24 2018 15:59
@AmitP88 :+1: , so you've decided make pomodoro without break timer?
Amit Patel
@AmitP88
Mar 24 2018 16:01
@IsaakNazar so far yeah lol. Although I might include it once I fully complete this timer. Still gotta see if I can further tweak the seconds circle (green), then include an outer minutes circle that the user can manipulate when incrementing or decrementing the minutes on the timer
Nazar
@IsaakNazar
Mar 24 2018 16:03
@AmitP88 Anyway, I like the design, :+1:
Amit Patel
@AmitP88
Mar 24 2018 16:04
@IsaakNazar thanks bro :)
CamperBot
@camperbot
Mar 24 2018 16:04
:cookie: 319 | @isaaknazar |http://www.freecodecamp.org/isaaknazar
amitp88 sends brownie points to @isaaknazar :sparkles: :thumbsup: :sparkles:
Amit Patel
@AmitP88
Mar 24 2018 16:04
I really appreciate that
Nazar
@IsaakNazar
Mar 24 2018 16:05
@AmitP88 I didn't even start my pomodoro, wanna create it with ReactJS
Amit Patel
@AmitP88
Mar 24 2018 16:06
@IsaakNazar ah I see. I haven't even touched React yet. I learned it a while back so I know the general concept behind it, but for now I'm focusing on upping my javascript
Nazar
@IsaakNazar
Mar 24 2018 16:07
@AmitP88 excellent, good luck man! See Ya :smile:
Amit Patel
@AmitP88
Mar 24 2018 16:08
@IsaakNazar thanks bro! you toop :)
CamperBot
@camperbot
Mar 24 2018 16:08
amitp88 sends brownie points to @isaaknazar :sparkles: :thumbsup: :sparkles:
api offline
Amit Patel
@AmitP88
Mar 24 2018 16:08
*too
Nazar
@IsaakNazar
Mar 24 2018 16:08
@AmitP88 Yo, thanx :smile:
CamperBot
@camperbot
Mar 24 2018 16:08
isaaknazar sends brownie points to @amitp88 :sparkles: :thumbsup: :sparkles:
:cookie: 271 | @amitp88 |http://www.freecodecamp.org/amitp88
Amit Patel
@AmitP88
Mar 24 2018 16:08
np :+1: :)
Kyle Holm
@thekholm80
Mar 24 2018 16:15
good morning /help
Rajaneesh R
@rajaneeshr
Mar 24 2018 16:18
hello world
Phoebe
@pl98
Mar 24 2018 16:21
Can anyone help me with collapsing the nav bar?
Kyle Holm
@thekholm80
Mar 24 2018 16:29
@pl98 Settings => JavaScript => Quick Add => Bootstrap 3
some bootstrap features require the bootstrap.js library as well as jQuery and bootstrap.css
Kelechi Chinaka
@ke1echi
Mar 24 2018 16:34
is it ok to start learning with fcc beta?
Kyle Holm
@thekholm80
Mar 24 2018 16:34
yep
you'll have to redo it when it becomes the 'standard' release, though
and you can't earn certs yet
but you can definitely start learning
Kelechi Chinaka
@ke1echi
Mar 24 2018 16:36
maybe i would exercise some patience
Kyle Holm
@thekholm80
Mar 24 2018 16:36
how's cs50 going?
nearly done?
Aditya
@ezioda004
Mar 24 2018 16:38
@thekholm80 Do you think doing react projects with create-react is fine or should I start from scratch?
Phoebe
@pl98
Mar 24 2018 16:38
@thekholm80 Oh I didn't know that! Thanks! Do you know how to style the line that appears above the menu items when you click on the hamburger icon?
CamperBot
@camperbot
Mar 24 2018 16:38
pl98 sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1741 | @thekholm80 |http://www.freecodecamp.org/thekholm80
Kelechi Chinaka
@ke1echi
Mar 24 2018 16:38
done? lol... nope @thekholm80
Kyle Holm
@thekholm80
Mar 24 2018 16:39
@pl98 i don't, sorry. restyling bootstrap stuff is outside my wheelhouse
Kelechi Chinaka
@ke1echi
Mar 24 2018 16:39
u want to continue the train? @thekholm80
Phoebe
@pl98
Mar 24 2018 16:39
@thekholm80 haha that's okay, anyone else? I can't seem to figure it out for some reason...
Kyle Holm
@thekholm80
Mar 24 2018 16:40
@ezioda004 there's a lot of benefit to create-react-app and i think it's an awesome tool, but learning how to set up your own project is a good (and really frustrating) experience
@kelechy train?
Kelechi Chinaka
@ke1echi
Mar 24 2018 16:41
cs50 @thekholm80
use the create-react-app, instead of setting up frm scratch @ezioda004
Aditya
@ezioda004
Mar 24 2018 16:42
@thekholm80 Any link I can get started on that? I'm clueless
Kyle Holm
@thekholm80
Mar 24 2018 16:42
@kelechy i've been meaning to redo that now that they've updated the course material (i did it a few years ago), maybe after i finish my final fCC projects
Aditya
@ezioda004
Mar 24 2018 16:42
@kelechy I'm using that but I'd like to experience frustration :D
Kelechi Chinaka
@ke1echi
Mar 24 2018 16:43
lol @ezioda004
Kyle Holm
@thekholm80
Mar 24 2018 16:43
@ezioda004 i don't have any tutorials to suggest. most of what i learned came from Stephen Girder's udemy course but i doubt it's been updated for the new webpack release yet
Kelechi Chinaka
@ke1echi
Mar 24 2018 16:43
o nice @thekholm80
i really want to finish it @thekholm80
Aditya
@ezioda004
Mar 24 2018 16:43
@thekholm80 I have that, but he seems to be using his own boiler plate? I havent completed, only reached till the redux part so I started the markdown today
Kelechi Chinaka
@ke1echi
Mar 24 2018 16:44
but its alot of work and time @thekholm80
Kyle Holm
@thekholm80
Mar 24 2018 16:45
@ezioda004 yeah, but if you look at his boilerplate you can get an idea of what's going on - it doesn't really explain why you need to do what you do, but it does give you a jumping off point for figuring it out yourself
@kelechy you can do it!
Aditya
@ezioda004
Mar 24 2018 16:46
@thekholm80 Ooh interesting, I'll give it a go thanks!
CamperBot
@camperbot
Mar 24 2018 16:46
ezioda004 sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1742 | @thekholm80 |http://www.freecodecamp.org/thekholm80
Kelechi Chinaka
@ke1echi
Mar 24 2018 16:47
:muscle: i can do it @thekholm80
thanks @thekholm80
CamperBot
@camperbot
Mar 24 2018 16:47
kelechy sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1743 | @thekholm80 |http://www.freecodecamp.org/thekholm80
Taiseer
@Taiseer
Mar 24 2018 16:51
Hi
it's been a long time
i have done some coding in this free code camp
in the last year
and now i am bac k
dont know what to do
Kelechi Chinaka
@ke1echi
Mar 24 2018 16:53
get back on track @Taiseer
Taiseer
@Taiseer
Mar 24 2018 16:53
yeah
i will
i am going to do a project on code pen i think
wish me luck
Aditya
@ezioda004
Mar 24 2018 17:04
@Taiseer Welcome and goodluck
Ken Haduch
@khaduch
Mar 24 2018 17:51
@thekholm80 - hello, just checking in for the afternoon - how's it going?
@Taiseer - welcome back - good luck getting up and running again!
Kyle Holm
@thekholm80
Mar 24 2018 18:19
@khaduch Hi Ken, all's well here - just about to head out for the day. how's your world?
shark-boy
@shark-boy
Mar 24 2018 20:53
image.png
How do I change the "params" word all at once?
This is VS Code editor btw
Henry
@GitHub-Henry
Mar 24 2018 21:00
@thekholm80 :wave:
Kyle Holm
@thekholm80
Mar 24 2018 21:00
@GitHub-Henry hi Henry
Henry
@GitHub-Henry
Mar 24 2018 21:02
@thekholm80 how goes it?
Kyle Holm
@thekholm80
Mar 24 2018 21:02
not bad, you? I'm having a nice, relaxing Saturday
Henry
@GitHub-Henry
Mar 24 2018 21:03
Just about to install a new light fixuture.
Kyle Holm
@thekholm80
Mar 24 2018 21:03
make sure you turn the power off at the breaker box!
or what comes next might shock you
Henry
@GitHub-Henry
Mar 24 2018 21:04
good advice, to the breaker box
Kyle Holm
@thekholm80
Mar 24 2018 21:04
:)
shark-boy
@shark-boy
Mar 24 2018 21:07
@thekholm80 I read the article but that's not what I want to do. "params" is highlighted, but when I start typing, the word isn't replaced--letters just get inserted wherever my cursor is. How do I replace the entire word when I start typing?
Kyle Holm
@thekholm80
Mar 24 2018 21:07
@shark-boy have you tried hitting your 'Insert' key?
shark-boy
@shark-boy
Mar 24 2018 21:08
I don't have an 'Insert' key on my MacBook
Kyle Holm
@thekholm80
Mar 24 2018 21:09
hmm
Christy Rettger
@ChristyRettger
Mar 24 2018 22:01
Hi all, Was wondering if anyone could give me some advice - I'm coding a responsive site based on a desktop and mobile phone design I was given (no in between sizes provided), and the two designs vary considerably as far as the content that appears grouped on different backgrounds, order of content, etc. Is it better to go back to the designer and request a more responsive-friendly design, or better just to have lots of html that's hidden in one version or the other, and a ton of media queries to make the design work as-is? Anyone experience this before?
Kyle Holm
@thekholm80
Mar 24 2018 22:12
@ChristyRettger that seems like an odd situation. was the designer expecting one site for mobile and one site for desktop, a la 2010?
VaseJS
@VaseJS
Mar 24 2018 22:15
@ChristyRettger without seeing the designs, what you mean by “vary considerably” could mean something very different than we understand. I would ask for “in between” sizes first otherwise you have just become the designer for those sizes. So unless you’re going to get extra pay for that, let the designer design and you just code.
Christy Rettger
@ChristyRettger
Mar 24 2018 22:18
@thekholm80 I'm guessing he's a print designer unfamiliar with responsive design? But I don't know, I've only worked with a few other designers and not run into this before. There is no logical grid, and the order changes so much I'm just not even sure where to start, unless I do it as two different sites. Does anyone do that these days? Do you give the client what he asked for, even it'll be a mess, or do you tell him it's not a responsive design and make the designer figure it out?
Kyle Holm
@thekholm80
Mar 24 2018 22:18
maybe make an effort to gently suggest there's a better way?
if they aren't interested, give them exactly what they ask for
no matter how silly it is
Christy Rettger
@ChristyRettger
Mar 24 2018 22:23
Ok that's what I wasn't sure- if as the developer it's my job to make it look like what they give me regardless of what I think of it, or if it's my job to help them understand how a responsive site should work, all the way down to having more than 2 sizes, which I would think should be pretty obvious to a designer? (the client owns a grocery store - so probably not real tech-savvy, just wants it to look nice)
Kyle Holm
@thekholm80
Mar 24 2018 22:24
i've never built anything for a paying customer, so take what i say with a grain of salt, but i can't imagine a situation where they wouldn't at least hear you out, even if they decide not to go with your suggestions
but people are weird, so ...
Christy Rettger
@ChristyRettger
Mar 24 2018 22:27
lol good point! Thank you @thekholm80 and @VaseJS for your suggestions! I'll try going back to the designer and see where that leads... :)
CamperBot
@camperbot
Mar 24 2018 22:27
christyrettger sends brownie points to @thekholm80 and @vasejs :sparkles: :thumbsup: :sparkles:
:cookie: 579 | @vasejs |http://www.freecodecamp.org/vasejs
:star2: 1744 | @thekholm80 |http://www.freecodecamp.org/thekholm80
Kyle Holm
@thekholm80
Mar 24 2018 22:29
@ChristyRettger good luck!
Lance
@texas2010
Mar 24 2018 23:50
hi who is pro at regex? i got stuck with regex challenge...
Kyle Holm
@thekholm80
Mar 24 2018 23:51
@texas2010 hi Lance, long time no see
regex is the devil
Lance
@texas2010
Mar 24 2018 23:51
@thekholm80 hi. i am been around lol
Kyle Holm
@thekholm80
Mar 24 2018 23:52
@texas2010 i use https://regex101.com/ to write my regex
Kyle Holm
@thekholm80
Mar 24 2018 23:52
in the bottom right is a helpful list of tools
Lance
@texas2010
Mar 24 2018 23:52
oh ok. i could try
Kyle Holm
@thekholm80
Mar 24 2018 23:54
@texas2010 that challenge looks tough
Lance
@texas2010
Mar 24 2018 23:54
yeah haha.