skip to Main Content

Reactjs – React 19 "ref as prop" and TypeScript

React 19 introduces a new alternative to the existing forwardRef that is called ref as prop: https://react.dev/blog/2024/12/05/react-19#ref-as-a-prop But unfortunately the example provided in the blog post is written in JavaScript, not TypeScript:: function MyInput({placeholder, ref}) { return <input placeholder={placeholder} ref={ref}…

VIEW QUESTION

Javascript – Prop is not giving effect

This is my react component const ButtonComponent = ({ children, onClick, disabled, className = "" }) => { console.log("class name is ", className); const buttonClassName = ` bg-green-700 flex hover:bg-green-500 transition duration-300 ease-in-out text-white h-auto text-base p-2 rounded-[5px] m-2 ${…

VIEW QUESTION
Back To Top
Search