📜  React js 中的条件渲染 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:11.203000             🧑  作者: Mango

代码示例5
function UserGreeting(props) {
  return 

Welcome back!

; } function GuestGreeting(props) { return

Please sign up.

; } function Greeting(props) { const isLoggedIn = props.isLoggedIn; if (isLoggedIn) { return ; } return ; } ReactDOM.render( // Try changing to isLoggedIn={true}: , document.getElementById('root') );