第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

無法呈現(xiàn)授權(quán)頁面

無法呈現(xiàn)授權(quán)頁面

叮當(dāng)貓咪 2023-03-03 15:43:49
我正在嘗試設(shè)置 firebase 身份驗(yàn)證。我有兩個(gè)組成部分。第一個(gè)是帶有 firebase.auth().currentUser 的應(yīng)用程序,我正在檢查是否有登錄用戶,然后如果有這樣的用戶,我會(huì)呈現(xiàn)頁面,如果沒有,我會(huì)呈現(xiàn)登錄頁面。第二個(gè)組件我只是從父級(jí)獲取處理程序并嘗試呈現(xiàn)登錄頁面?,F(xiàn)在我只看到空白頁和錯(cuò)誤“'props' 未定義”。請(qǐng)幫我解決它。應(yīng)用程序.jsimport React, {Component} from "react";import {    BrowserRouter as Router,    Switch,    Route,    Link} from "react-router-dom";import { Layout } from 'antd';import AddStock from './components/stocksDB/addStock';import { Typography, Menu } from 'antd';import 'antd/dist/antd.css';import './App.css';import AddClient from './components/clients/addClient.js';import PifForm from './components/clients/pif/pifForm';import KuaForm from './components/clients/pif/kuaForm';import firebase from './firebase.js';import {Login} from './components/login.js'const { Title } = Typography;const {Header, Footer, Content} = Layout;class App extends Component {    constructor(props){        super(props);        this.state = {            login: '',            password: ''        }    }    handleChange = (event) => {        const target = event.target;        const name = target.name;        this.setState({            [name]: target.value        }, () => {console.log(name, this.state)})    };    signUp = () => {        firebase.auth().createUserWithEmailAndPassword(this.state.login, this.state.password).catch(function(error) {            console.log(error);        })    };    signIn = () => {        firebase.auth().signInWithEmailAndPassword(this.state.login, this.state.password).catch(function(error) {            console.log(error);        })    };    onFinishFailed = errorInfo => {        console.log('Failed:', errorInfo);    };
查看完整描述

2 回答

?
慕萊塢森

TA貢獻(xiàn)1810條經(jīng)驗(yàn) 獲得超4個(gè)贊

由于Login是功能組件,您需要像這樣傳入并定義道具:const Login = (props) => {props.handleChange然后,您可以使用和訪問道具props.signUp。

無需在功能組件內(nèi)部未定義的this基于類的組件中使用 like 。this


查看完整回答
反對(duì) 回復(fù) 2023-03-03
?
達(dá)令說

TA貢獻(xiàn)1821條經(jīng)驗(yàn) 獲得超6個(gè)贊

你正在調(diào)用 props 但你還沒有在你的功能組件中定義它。

export const Login = (props) => {
...

}


查看完整回答
反對(duì) 回復(fù) 2023-03-03
  • 2 回答
  • 0 關(guān)注
  • 150 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)