How to CONDITIONAL RENDER in React ❓

Поделиться
HTML-код
  • Опубликовано: 6 янв 2025
  • Conditional rendering = allows you to control what gets rendered in your application based on certain conditions. (ex. show, hide, or change components)

Комментарии • 49

  • @senisia
    @senisia Год назад +12

    i love your new react series. I just started learning it and you came out of nowhere

  • @BroCodez
    @BroCodez  Год назад +19

    import UserGreeting from './UserGreeting.jsx'
    function App() {
    return(



    );
    }
    export default App
    import PropTypes from 'prop-types';
    function UserGreeting(props){
    const welcomeMessage =
    Welcome {props.username}

    const loginPrompt =
    Please log in to continue

    return(props.isLoggedIn ? welcomeMessage : loginPrompt);
    }
    UserGreeting.proptypes = {
    isLoggedIn: PropTypes.bool,
    username: PropTypes.string,
    }
    UserGreeting.defaultProps = {
    isLoggedIn: false,
    username: "Guest",
    }
    export default UserGreeting
    .welcome-message{
    font-size: 2.5em;
    background-color: hsl(120, 100%, 42%);
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin: 0;
    }
    .login-prompt{
    font-size: 2.5em;
    background-color: hsl(0, 100%, 42%);
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin: 0;
    }

    • @imbomb
      @imbomb Год назад

      Pls I beg of you don't relent so as we aren't.Just keep posting videos till this module is complete.React is a very important aspect in Frontend Development

    • @unknown-person-14.
      @unknown-person-14. Год назад

      i beg you to make a small python episode in which you will teach how to communicate between server and client in lan using sockets and how to move a thing from buttons using server so connected clients would see the change

    • @anesmessahli5863
      @anesmessahli5863 Год назад

      Yo pls can u suggest to me wich video i should watch to learn html and css .. you have a 1hour video of html and 1hour video of css also you have a 4hour video such as a combination between the last twos.. so what should i watch ?

    • @Orion_news
      @Orion_news Год назад

      bro please make mastery level detail. detail to detail python full couse , make a course that by doing that one can become Albert Einstain of coding.

  • @g.ryanpeterson9686
    @g.ryanpeterson9686 Год назад +1

    Just started learning React and your videos are very easy to follow and learn from. Thank you!!

  • @aungaungab1967
    @aungaungab1967 Год назад +14

    Please make a full react series course 🙏🙏🙏🙏🙏

  • @TahaZolfi
    @TahaZolfi Год назад +1

    bro code teaches you so good that u feel its so easy

  • @Soulcode-k
    @Soulcode-k Месяц назад

    Such a nice video it is so refreshing.😊

  • @Legacylanes_moto
    @Legacylanes_moto Год назад

    great series bro.. byte sized tutorials makes life easier. Thanks.. waiting for more.

  • @NazneenNaharNishi
    @NazneenNaharNishi Год назад +2

    Bro make a complete tutorial for android development.....Your courses are completely educative.❤❤❤❤❤

  • @eduardokawaguchi3086
    @eduardokawaguchi3086 5 месяцев назад

    Nice video, Bro! Here's a quick tip: press "alt +z" in your script, it'll break the rows automatically.

  • @shivanshuhere
    @shivanshuhere Год назад

    simple and clear explanation :)
    loved it

  • @xenos112
    @xenos112 Год назад

    Even though I know React, I enjoy watching your videos

  • @name_yug
    @name_yug Год назад +1

    Pls make a full course on react and typescript

  • @elawet435
    @elawet435 Год назад +1

    Thank u so much my Bro

  • @houdariyad4889
    @houdariyad4889 Год назад

    can't thank u enough bro

  • @Jishanthegodev
    @Jishanthegodev Год назад

    Thank you so much sir ❤❤

  • @ngehbrandon9491
    @ngehbrandon9491 Год назад

    Thanks for the video bro

  • @d1ce966
    @d1ce966 Год назад

    Bro post more react i love it

  • @lokrajpyakurel2563
    @lokrajpyakurel2563 Год назад

    Waiting for new video on React from Bro Code 😊

  • @unknown-person-14.
    @unknown-person-14. Год назад

    i beg you to make a small python episode in which you will teach how to communicate between server and client in lan using sockets and how to move a thing from buttons using server so connected clients would see the change

  • @binuthomasphilip6061
    @binuthomasphilip6061 2 месяца назад

    Pl make more videos on react

  • @pintertenan8057
    @pintertenan8057 Год назад +1

    Greeting from a bro!

  • @andromilk2634
    @andromilk2634 11 месяцев назад

    Since you were using Javascript variables, wouldn't you need to use {} on here as well like you usually do? Or are those not necessary in conditionals? Thanks!

    • @phoenixaxis329
      @phoenixaxis329 25 дней назад

      I think they're only necessary when you're including js in an html element, Since before the return statement it is okay to write js, there's no need for {}
      But I'm sure you've learnt by now😄

  • @יהונתןריזי
    @יהונתןריזי Год назад

    do you plan to make advance c# course ?

  • @bladebeats7375
    @bladebeats7375 Год назад

    please make a video on how to automate ur work using python

  • @Ceszilla
    @Ceszilla Год назад

    Can you please explain how to upload images to a react project?

  • @graiselin2791
    @graiselin2791 Год назад

    Love you 😘😘

  • @otabekmadaminov-z2i
    @otabekmadaminov-z2i 4 месяца назад

    Thank you bro

  • @hunin27
    @hunin27 Год назад

    thanks! ❤

  • @1T_pressly
    @1T_pressly Год назад

    Thank you bro for the code

  • @Ken-zh4gu
    @Ken-zh4gu 10 месяцев назад

    Please do full django course python web development framework if you can

  • @Orion_news
    @Orion_news Год назад

    bro please make mastery level detail. detail to detail python full couse , make a course that by doing that one can become Albert Einstain of coding.

  • @manojmurugan590
    @manojmurugan590 Год назад

    Bro please upload full video
    How to contact you for courses for paid

  • @vishnuk6417
    @vishnuk6417 Год назад

    Hii.....! it's 13th comment 😍😍

  • @a_e_l_i_y_a
    @a_e_l_i_y_a Месяц назад

    bro code likes hsl value

  • @Gunz1234
    @Gunz1234 Год назад

    Bro Code ❤

  • @Yakuzanis
    @Yakuzanis Год назад

    Bro Code = Chad Code

  • @kaungkinzone2448
    @kaungkinzone2448 Год назад

    random comment 4.0

  • @Delicatamente
    @Delicatamente 8 месяцев назад

    huge thanks!