タグ: visualeditor
タグ: visualeditor
6行目: 6行目:


==JavaScript==
==JavaScript==
? operator など、Conditional rendering を使う。<syntaxhighlight lang="javascript" line="1">
? operator など、Conditional rendering を使う。<syntaxhighlight lang="jsx" line="1">
// if statement
// if statement
let content;
let content;

2026年6月24日 (水) 01:09時点における版

ファイル:react-logo.png
React
  • コンポーネント
  • Props
  • State

JavaScript

? operator など、Conditional rendering を使う。<syntaxhighlight lang="jsx" line="1"> // if statement let content; if (isLoggedIn) {

 content = <AdminPanel />;

} else {

 content = <LoginForm />;

} return (

   {content}

);

// ? operator

 {isLoggedIn ? (
   <AdminPanel />
 ) : (
   <LoginForm />
 )}

</syntaxhighlight>

Next.js

Next.js を参照。