skip to Main Content

How can I rewrite this?

Considering such code below: const [list, setList] = useState([]); const [curPage, setCurPage] = useState(0); const fetchItem = useCallback(async ()=>{ const data = await callAPI(); // data is an object setList(prev => [...prev, data]); },[]); useEffect(()=>{ if(list.length - 1 < curPage)…

VIEW QUESTION

What can we do to improve our environment?

I have a banner a follows: I need to display Title on left most side and icon on the right most side. Here is my code: <div className={classNames.root} role="banner"> <div className={classNames.left}> Title </div> <div className={classNames.right}><SettingsIcon /></div> </div> root: [ {…

VIEW QUESTION

Can we rewrite this?

hello friends please I am using the styled component for my react project and have been stuck for days now while trying to add a hover effect to the icons in my header component. i would appreciate if anyone can…

VIEW QUESTION

What can I do to improve my writing?

In my react with typescript project, I'm using the Formik component alongside Yup validation schema to validate an address form. At the moment, it work fine for an existing user, because the initialValues are populated with valid data. Also, it…

VIEW QUESTION
Back To Top
Search