DEV Community

Discussion on: Project 50 of 100 - Firebase Sign Up and Login with React Router

Collapse
 
youssefrabeiii profile image
Youssef Rabei

Hey James great post, i loved it but if you want your code to be highlighted "Colored" like this

const [userExists,setUserExists] = useState(false);

auth.onAuthStateChanged((user) => {
    if (user) {
      setUserExists(true);
      console.log('Signed in as '+user.email);
    } else {
      setUserExists(false);
    }
  });
Enter fullscreen mode Exit fullscreen mode

add the language like javascript or jsx "I used jsx for the code above" after the three "backticks" (No spaces between them)

and just a note it would be better if you displayed a paragraph when there is an error not an alert so you can style it with CSS

Collapse
 
ridhikgovind profile image
Ridhik Govind

Nice tip. Gonna implement it next time in my next article. Thanks :)

Collapse
 
jameshubert_com profile image
James Hubert

Hey! How'd you do this Youssef? This is really great.

Collapse
 
youssefrabeiii profile image
Youssef Rabei

Everytime I try to show it it automatically make it code but you should put the language name after the three backticks (the three things that look like a comma) and it will highlight it automatically

Thread Thread
 
jameshubert_com profile image
James Hubert

Oh got it. Like

some code here...
Enter fullscreen mode Exit fullscreen mode
Thread Thread
 
jameshubert_com profile image
James Hubert

Nice!

const thankful = true;

if (thankful) {
  console.log("Thanks Youssef!");
}
Enter fullscreen mode Exit fullscreen mode