Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

react login

import React  from 'react'
import Container from 'react-bootstrap/Container';
import Nav from 'react-bootstrap/Nav';
import Navbar from 'react-bootstrap/Navbar';
export default function Header(){
   return(<>    
   <Navbar bg="dark" variant="dark">
           <Container>
             <Navbar.Brand href="#home">To DO</Navbar.Brand>
             <Nav className="me-auto">
                <Nav.Link href="#home">Home</Nav.Link>
               <form onSubmit={handleLogin} >
               <input type="text" placeholder="username" name="username"></input>
               <input type="password" placeholder="password" name="password"></input>
               <button className="btn1" type="submit"  >Login</button>
              </form> 
              <h5 id="head"> not a user !? signup here </h5>
              <form  >
               <input type="text" placeholder="username" name="username"></input>
               <input type="password" placeholder="password" name="password"></input>
              <button className="btn1" type ="submit" href="register" >signup</button>
             
              </form>
             </Nav>
           </Container>
         </Navbar>   
   </>)
 } 

Comment

react components for login

import React, { Component } from "react";


export default class Login extends React.Component
{
    constructor(props)
    {
        super(props);
        this.state ={email:"", password:""};
    }
    render()
    {
        return <div className="col-lg-9">
            <h4 className="m-1 p-2 border-bottom">Login</h4>
            <div className="form-group form-row">
                <label className="col-lg-4">Email:</label>
                <input type="text" className="form-control" value={this.state.email}
                onChange={(event)=>{this.setState({email:event.target.value}); console.log(this.state.email);}}/>
            </div>
            <div className="form-group form-row">
                <label className="col-lg-4" value={this.state.password} 
                onChange={(event)=>{this.setState({password:event.target.value}); console.log(this.state.password);}} >Password:</label>
                <input type="password" className="form-control"/>
            </div>
            <div>
                <button className="btn btn-primary" onClick={this.onLoginClick}>Login</button>
            </div>
        </div>;
    }
    onLoginClick = () =>
    {
    };
}
Comment

PREVIOUS NEXT
Code Example
Typescript :: htmlspecialchars() expects parameter 1 to be string array given in laravel blade 
Typescript :: python compare lists unordered 
Typescript :: custom events in unity c# 
Typescript :: conditional type typescript 
Typescript :: What kind of projects is suitable for the Agile methodology 
Typescript :: SafeValue must use [property]=binding: 
Typescript :: Request exceeded the limit of 10 internal redirects due to probable configuration error 
Typescript :: ts compile command 
Typescript :: paths typescript 
Typescript :: typescript delete value from map 
Typescript :: mongodb nest.js 
Typescript :: angular type of string 
Typescript :: typescript document.getelementbyid object is possibly null 
Typescript :: asciidots helloworld 
Typescript :: rascal npm 
Typescript :: ts new map literal 
Typescript :: typescript compile stop using required 
Typescript :: concat and nunll check in typescript 
Typescript :: Will Tenet come in plate format 
Typescript :: typescript event emitter 
Typescript :: he .native modifier for v-on is only valid on components but it was used on <a. 
Typescript :: terrform variable list type 
Typescript :: gdscript remove deleted objects from array 
Typescript :: nativescript date input validation 
Typescript :: Convert Tupe to Object TypeScript 
Typescript :: header elements on right 
Typescript :: stats splunk many fields 
Typescript :: slider dots css 
Typescript :: how many elements can be stored in an array 
Typescript :: config all requests to one page nginx 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =