摘要: Today modern browsers added native support for lazy loading images, and we can benefit from it by adding one simple attribute to our img element: <img 阅读全文
posted @ 2020-09-01 22:33 Zhentiw 阅读(148) 评论(0) 推荐(0)
摘要: React is really good at creating and updating DOM elements, but sometimes you need to work with them yourself. A common use case for this is when you’ 阅读全文
posted @ 2020-09-01 19:05 Zhentiw 阅读(149) 评论(0) 推荐(0)
摘要: Something that’s important to recognize is that every time you call the state updater function (like the setName function in our component), that will 阅读全文
posted @ 2020-09-01 18:54 Zhentiw 阅读(135) 评论(0) 推荐(0)
摘要: Sometimes you have some boilerplate for components that would be nice to abstract away slightly with a simple helper function. In this lesson we'll le 阅读全文
posted @ 2020-09-01 15:30 Zhentiw 阅读(134) 评论(0) 推荐(0)
摘要: Returning null will not update state and trigger a component re-render Example: updateMocktail = mocktail => { const newMocktail = mocktail; this.setS 阅读全文
posted @ 2020-09-01 15:10 Zhentiw 阅读(166) 评论(0) 推荐(0)