Last active
August 6, 2021 11:27
-
-
Save percybolmer/f581618d900c155d66ce756cdf8f1b99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logo from './logo.svg'; | |
import './App.css'; | |
// These imports are important | |
import React, { useState, useEffect } from 'react'; | |
import Web3 from 'web3-eth' | |
function App() { | |
// this will trigger whenever the App function is called, which index.js runs at startup | |
useEffect(() => { | |
// Here we check if there is web3 support | |
if (typeof web3 !== 'undefined') { | |
}else { | |
// The browser has no web3 | |
// Suggest the user to install a web3 compatible browser plugin | |
throw new Error("No web3 support, redirect user to a download page or something :) "); | |
} | |
}); | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<p> Welcome to your DAPP application</p> | |
</header> | |
</div> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment