Want everyone on your software team to learn this? Free 14-day trial.
Train my teamApplication.jsxconst apiKey = '{{INSERT_API_KEY_HERE}}';
function App() {
const [message] = useState('Welcome, new user! Fetching your data...');
useEffect(() => {
// Load in data using the pre-populated API key.
fetch('/api/profile', {
headers: {
Authorization: `Basic ${btoa(`${apiKey}:`)}`,
},
}).then(loadWelcomePage);
}, []);
return (
<div className="component-app">
<Message value={message} />
</div>
);
}
createRoot(document.getElementById('root')).render(<App />);