You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a single digit number is shown then it is written as 7 instead of 07 even though in transform, there is a pad(00). Maybe the , is shown instead of 0 idk?
importReactfrom"react";import"@pqina/flip/dist/flip.min.css";import{EventCountdown}from"./EventCountdown";exportdefaultfunctionApp(){return(<div><h1>Flip padding not working</h1><h1><EventCountdownvalue="2021-01-01T00:00:00+01:00"/></h1></div>);}
EventCountdown.js
importReact,{useRef,useEffect,useState}from"react";importTickfrom"@pqina/flip";exportconstEventCountdown=({ value })=>{constdivRef=useRef();consttickRef=useRef();const[tickValue,setTickValue]=useState(value);// Make the Tick instance and store it in the refsuseEffect(()=>{constdidInit=tick=>{tickRef.current=tick;};constcurrDiv=divRef.current;consttickValue=tickRef.current;Tick.DOM.create(currDiv,{
value,
didInit
});return()=>Tick.DOM.destroy(tickValue);},[value]);// Start the Tick.down processuseEffect(()=>{constcounter=Tick.count.down(value);// When the counter updates, update React's state valuecounter.onupdate=function(value){setTickValue(value);};return()=>{counter.timer.stop();};},[value]);// When the tickValue is updated, update the Tick.DOM elementuseEffect(()=>{if(tickRef.current){tickRef.current.value=tickValue;}},[tickValue]);return(<divclassName="tick"><divdata-repeat="true"data-layout="horizontal fit"data-transform="preset(d, h, m, s) -> delay"><divclassName="tick-group"><divref={divRef}data-repeat="true"data-transform="pad(00) -> split -> delay"><spandata-view="flip"/></div><spandata-key="label"data-view="text"className="tick-label"/></div></div></div>);};
The text was updated successfully, but these errors were encountered:
When a single digit number is shown then it is written as
7
instead of07
even though in transform, there is apad(00)
. Maybe the,
is shown instead of0
idk?Same codesandbox demonstrating what I am talking about: https://codesandbox.io/s/flip-padding-not-working-bqmwg?file=/src/EventCountdown.js
Here's the code for brevity:
App.js
EventCountdown.js
The text was updated successfully, but these errors were encountered: