firebaseのGoogleログインを実装したくて、react-firebase-hooksを「npm install --save react-firebase-hooks」コマンドでインストールしたのですが、使用したところ、Module not found....と表示されました。
コードは以下の通りです。
---App.js---
import "./App.css";
import SignIn from "./components/SignIn";
import { useAuthState } from "react-firebase-hooks";
import { auth } from "./firebase.js";
import Success from "./components/Success.js";
function App() {
const user = useAuthState(auth);
return <div>{user ? <Success /> : <SignIn />}</div>;
}
export default App;
---package.json---
{
"name": "line-clone-yt",
"version": "0.1.0",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@mui/icons-material": "^5.14.12",
"@mui/material": "^5.14.12",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"firebase": "^10.4.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-firebase-hooks": "^5.1.1",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。