Skip to main content

TEMP - Codeblocks

Codeblock
function Greeting(props) {
return <p>Welcome, {props.userName}!</p>;
}

export default Greeting;
Highlight Lines
function HighlightText(highlight) {
if (highlight) {
return 'This text is highlighted!';
}
return 'Nothing highlighted';
}

function HighlightMoreText(highlight) {
if (highlight) {
return 'This range is highlighted!';
}
return 'Highlighted';
}
Line Numbers
import React from 'react';

function UserProfile(props) {
const { username, email, isAdmin } = props;

return (
<div>
<h1>User Profile</h1>
<p>Username: {username}</p>
<p>Email: {email}</p>
{isAdmin && <p>Admin User</p>}
</div>
);
}

export default UserProfile;
Line Numbers with Highlight
import React from 'react';

function UserProfile(props) {
const { username, email, isAdmin } = props;

return (
<div>
<h1>User Profile</h1>
<p>Username: {username}</p>
<p>Email: {email}</p>
{isAdmin && <p>Admin User</p>}
</div>
);
}

export default UserProfile;