Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

react timer

import React from 'react';
import { useTime } from 'react-timer-hook';

function MyTime() {
  const {
    seconds,
    minutes,
    hours,
    ampm,
  } = useTime({ format: '12-hour'});

  return (
    <div style={{textAlign: 'center'}}>
      <h1>react-timer-hook </h1>
      <p>Current Time Demo</p>
      <div style={{fontSize: '100px'}}>
        <span>{hours}</span>:<span>{minutes}</span>:<span>{seconds}</span><span>{ampm}</span>
      </div>
    </div>
  );
}

export default function App() {
  return (
    <div>
      <MyTime />
    </div>
  );
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript change input value jquery 
Javascript :: javascript find the longest string in array 
Javascript :: hashtable js 
Javascript :: javascript add days 
Javascript :: on reload js 
Javascript :: Download excel using reactJS 
Javascript :: react native clear route params 
Javascript :: javascript check if visible 
Javascript :: working with json in javascript 
Javascript :: uppercase-the-first-letter-of-a-string-using-javascript/ 
Javascript :: react build blank page 
Javascript :: jquery datatable rest api 
Javascript :: Como saber se existe um atributo em um objeto 
Javascript :: Adding a Method to a JavaScript Object 
Javascript :: javascript array read object value in array 
Javascript :: expres body parser 
Javascript :: javascript next friday 
Javascript :: set body id js 
Javascript :: move last element of array to begining javascript 
Javascript :: chart.js clear data 
Javascript :: sweet alert angular 
Javascript :: javascript date parse yyyy-mm-dd 
Javascript :: javascript foreach arrow function 
Javascript :: learn mongodb 
Javascript :: js get each pair of values from an array of objects 
Javascript :: react router redirect with query params 
Javascript :: svg to png base64 javascript 
Javascript :: nextjs react native web typescript 
Javascript :: check browser 
Javascript :: sum of all elements in array javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =