Best of React Hooks โ May 2023
- 1
- 2
builder.ioยท3y
How to Test Custom React Hooks with React Testing Library
Custom React hooks offer developers the ability to extract and reuse common functionality across multiple components. Testing these hooks can be tricky, especially if you are new to testing. In this blog post, we will explore how to test a custom React hook using React Testing Library.
- 3
Mediumยท3y
useRef vs. useState in React
Understanding the differences between useRef and useState hooks in React and knowing when to use each hook is crucial for writing effective and optimized React components. useRef is primarily used to access and manipulate the DOM or store mutable values without triggering re-renders. useState is used for managing component state, triggering re-renders when the state updates.
- 4
- 5
Community Picksยท3y
Custom Tooltip Directive in Vuejs 3: Tutorial
The most important forms for code reuse in Vuejs are components and composable if you write components with composition API. Mixins, directives, and plugins can further improve your code's maintainability and reusability. Plugins, on the other hand, are packages that can be installed and used across multiple components in your application.
- 6
Hacker Newsยท3y
vadimdemedes/ink: ๐ React for interactive command-line apps
Ink provides the same component-based UI building experience that React offers in the browser. Ink uses Yoga to build Flexbox layouts in the terminal, so most CSS-like props are available in Ink. If you're looking for docs on Ink 3, check out this release.