step 1
import { useMoralis } from "react-moralis";
step 2
const { authenticate, isAuthenticated, user, logout } = useMoralis();
// Failed to compile from call useMoralis above. π€π€π€
step 3
import React from 'react'
import './App.css'
import constant, { System } from './constant'
import { ToastContainer } from 'react-toastify'
import { HashRouter as Router, Switch, Route } from 'react-router-dom'
import { MoralisProvider } from "react-moralis";
import 'react-toastify/dist/ReactToastify.css'
function App() {
const routeComponents = constant.routers.map(({ url, component }, key) => (
<Route exact path={url} component={component} key={key} />
))
return (
<div>
<MoralisProvider appId={System.APP_ID} serverUrl={System.SERVER_URL}> {/* failed to compile <MoralisProvider> */}
{/* <Router basename="/aom"> */}
<Router basename="">
<Switch>{routeComponents}</Switch>
</Router>
<ToastContainer />
</MoralisProvider> {/* failed to compile <MoralisProvider> */}
</div>
)
}
export default App
Environment
windows 11
Nodejs v16.13.0
React project created by: React Create App Typescript Version.
I have tested villain HTML to add Moralia that worked well.
but I hope ingredient React-Moralia.
Please help Thank you.