These are chat archives for FreeCodeCamp/Help

11th
Mar 2019
Christopher McCormack
@cmccormack
Mar 11 00:38
@Nirajn2311 that's great to know, thanks!
abraham anak agung
@padunk
Mar 11 09:33
Thanos of the day https://thanosjs.org
Uzma Khan
@meow414
Mar 11 10:30
please help me to write correct regex here for Calculator,I need to pass tests no. 11 and 13,here is link to my codepen https://codepen.io/meow414/pen/QogvNz?editors=0010
 if (e.target.id == "decimal") {
      // when decimalCounter is <=1 that data is allowed to be entered in this.state.calcString
       //when simple digits like 5 are entered decimal should be allowed once until something like 5.5 is entered
        decimalCounter++;
      if (decimalRegex.test(str)) {
        let newStr=str.slice(decimalRegex.lastIndex);
        console.log(newStr)
        //whenever something of type 5.5 is found no more decimal should be allowed until next operator is found
        if(decimalRegex.test(newStr)){
           decimalCounter=2;
          console.log("here")
        }else{
          decimalCounter=decimalCounter;
          console.log("there")
        }

      } 
    } else {
      //when other buttons are pressed except decimal,they should be allowed to be entered by setting  decimalCounter = 0
      decimalCounter = 0;

    }
kibablu
@kibablu
Mar 11 11:08
Hey all ... How to contribute to open source projects if you're a bigger? any projects I can dive in?
Philip Durbin
@pdurbin
Mar 11 11:33
You could take a look at https://www.firsttimersonly.com
@kibablu
yj
@atangyj
Mar 11 18:09
Hi everyone, how do you check if the component is rendered as expected?
Christopher McCormack
@cmccormack
Mar 11 18:48
@atangyj what framework are you using?
yj
@atangyj
Mar 11 18:49
React
Christopher McCormack
@cmccormack
Mar 11 18:49
@atangyj What precisely do you want to see? If it rendered you should see it in the DOM in the browser
yj
@atangyj
Mar 11 18:51
I have multiple pages. The root DOM has rendered the components of home page. I am creating components for other pages. How could I render it to see the results?
Christopher McCormack
@cmccormack
Mar 11 18:52
is this a single page app (SPA) or are you loading a different bundle for each route?
yj
@atangyj
Mar 11 18:53
single page
Christopher McCormack
@cmccormack
Mar 11 18:54
Are you using a Router like React Router?
yj
@atangyj
Mar 11 18:54
yes
Christopher McCormack
@cmccormack
Mar 11 18:54
Are you just asking about testing? There are testing suites like Enzyme or React Testing Library you could check out, I believe at least one of these lets you test components in isolation
yj
@atangyj
Mar 11 18:55
I am not doing testing. i just want to check the style effect
Jason Luboff
@JLuboff
Mar 11 18:56
Can you not test it by interacting with your app then..?