上一页 1 ··· 334 335 336 337 338 339 340 341 342 ··· 477 下一页
摘要: By default the React Component Tree directly maps to the DOM Tree. In some cases when you have UI elements like overlays or loading bars this can be l 阅读全文
posted @ 2017-09-28 20:59 Zhentiw 阅读(262) 评论(0) 推荐(0)
摘要: In this session we create a comment component to explore how to create components that only render text. In previous versions of we had to wrap our te 阅读全文
posted @ 2017-09-28 04:06 Zhentiw 阅读(183) 评论(0) 推荐(0)
摘要: x, y, z = 0, 1, 0 if x == 1 or y == 1 or z == 1: print('passed') if 1 in (x, y, z): print('passed') # These only test for truthiness: if x or y or z: print('passed') if any((x, y, z))... 阅读全文
posted @ 2017-09-27 20:00 Zhentiw 阅读(200) 评论(0) 推荐(0)
摘要: If you want to style host component. You can use ':host-context'. In the host component, we have 'styled-component' class, we want to apply some css t 阅读全文
posted @ 2017-09-27 00:58 Zhentiw 阅读(1995) 评论(0) 推荐(0)
摘要: The code we want to trasform: transform to: Code: 阅读全文
posted @ 2017-09-26 18:19 Zhentiw 阅读(446) 评论(0) 推荐(0)
摘要: In JS, we have object spread opreator: In python we can do: 阅读全文
posted @ 2017-09-26 16:25 Zhentiw 阅读(231) 评论(0) 推荐(0)
摘要: The rule we want to write is show warning if user using console method: Rule: 'looksLike' & isPrimitive is pretty handy, you can save as until lib. 阅读全文
posted @ 2017-09-26 03:38 Zhentiw 阅读(297) 评论(0) 推荐(0)
摘要: What we want to do is checking if user write nested if statements which actually can combine to one: Notice that if statement can write with block sta 阅读全文
posted @ 2017-09-25 21:06 Zhentiw 阅读(346) 评论(0) 推荐(0)
摘要: We want to write a Babel Plugin, which move 'const versionRegex = /(/d+)\.(/d+)\.(/d+)/gi' out of function scope and put it into global scope. Code: A 阅读全文
posted @ 2017-09-24 18:26 Zhentiw 阅读(397) 评论(0) 推荐(0)
摘要: To write a simple Babel plugin, we can use http://astexplorer.net/ to help us. The plugin we want to write is: We want to trasnform the code which hig 阅读全文
posted @ 2017-09-24 18:24 Zhentiw 阅读(335) 评论(0) 推荐(0)
上一页 1 ··· 334 335 336 337 338 339 340 341 342 ··· 477 下一页