Answers for "how to get the height of a react native component"

-1

get height component react

import React, { useState, useEffect, useRef } from 'react'

export default () => {
  const [height, setHeight] = useState(0)
  const ref = useRef(null)

  useEffect(() => {
    setHeight(ref.current.clientHeight)
  })

  return (
    <div ref={ref}>
      {height}
    </div>
  )
}
Posted by: Guest on September-19-2021
0

react native height full

flex:1,
Posted by: Guest on August-19-2021

Code answers related to "how to get the height of a react native component"

Code answers related to "Javascript"

Browse Popular Code Answers by Language