タグ: visualeditor |
タグ: visualeditor |
||
| 6行目: | 6行目: | ||
==JavaScript== | ==JavaScript== | ||
? operator など、Conditional rendering を使う。<syntaxhighlight lang=" | ? operator など、Conditional rendering を使う。<syntaxhighlight lang="jsx" line="1"> | ||
// if statement | // if statement | ||
let content; | let content; | ||
2026年6月24日 (水) 01:09時点における版
- コンポーネント
- 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 を参照。