Tag: React
All the articles with the tag "React".
TypeScript: object is possibly 'undefined'
Updated: at 08:30 PMTS2532: Object is possibly 'undefined'. TS18048: 'players' is possibly 'undefined'. Guard the value before you read it. The ! operator only hides the error.
How to Make Next.js 13 More SEO-Friendly
Updated: at 02:04 PMAre you struggling with getting your Next.js 13 app to rank well on search engines? I’ll show you some essential SEO optimizations that you can implement.
Mocking GraphQL response for React components using MockedProvider
Updated: at 06:06 PMIn GraphQL-powered React apps, testing component behavior based on GraphQL data is a common scenario. Let's see how to achieve that with MockedProvider.
How to Write Stronger Unit Tests with Jest
Updated: at 10:08 AMWe'll explore why weak tests can leave changes in behavior to land unnoticeably and what we can do to catch these changes early.
How to Test Custom Hooks with React Testing Library and Jest
Updated: at 10:08 AMLearn how to test your custom React Hooks with React Testing Library and Jest. You'll find an interactive Codesandox at the end of the post.
How to test props in React Testing Library
Updated: at 12:00 PMMock the child with jest.mock and read the prop from the text. On Jest 30 the mock variable's name has to start with mock.