Tag: React

  • React TS createContext()

    Using context in your react app is really useful, when you are passing some prop to multiple nested elements for example Theme How to use it? In this example we will make Theme provider. Create ThemeProvider.tsx It will hold our wrapper that implements the theme for all child components. Then make Class or functional component…

  • React TS useRef() hook

    This hook is useful when we are trying to read some input field or when we just need the reference to the element for getting size or other properties. How to use it? imagine we are trying to make a tooltip under some element when user hovers over it and now we can use it…

  • React Formic vs. Use-Form

    Handling react forms efficiently is a crucial task. Two popular libraries that simplify form management are Formik and react-hook-form (often referred to as use-form). Formik: Pros: Cons: react-hook-form (use-form): Pros: Cons: If you value a comprehensive solution with a large community and don’t mind a steeper learning curve, Formik might be the right choice. On…