条件渲染 在 React 中,你可以创建不同的组件来封装各种你需要的行为。然后还可以根据应用的状态变化只渲染其中的一部分。 ...
分类:
其他好文 时间:
2020-05-05 12:23:22
阅读次数:
45
1、为什么使用typeScript? typeScript是JavaScript的超集 typeScript在编译期间就可以将错误抛出 增强代码的可阅读性和可维护性 2、案例的功能逻辑 切换职业 选择服务区域 选择服务品种 选择服务承诺 3、使用命令创建react Native的typescript ...
分类:
其他好文 时间:
2020-05-05 10:31:48
阅读次数:
144
vue和react的diff算法,都是忽略跨级比较,只做同级比较。vue diff时调动patch函数,参数是vnode和oldVnode,分别代表新旧节点。 1. vue比对节点,当节点元素类型相同,但是className不同,任务是不同类型元素,删除重建,而react会认为是同类型节点,只是修改 ...
分类:
编程语言 时间:
2020-05-05 00:31:36
阅读次数:
551
一、相同点 1.都有组件化开发和Virtual DOM 2.都支持props进行父子组件间数据通信 3.都支持数据驱动视图,不直接操作真实的DOM,更新状态数据界面就自动更新 4.都支持服务器端渲染 5.都有支持native的方案,react的react native vue的weex 二、不同点 ...
分类:
其他好文 时间:
2020-05-04 21:08:42
阅读次数:
58
It's always important to test your code, especially if you're open-sourcing it for others to use. In this video, we'll learn how to use react-hooks-te ...
分类:
其他好文 时间:
2020-05-04 19:40:17
阅读次数:
73
感谢 王下邀月熊_Chevalier 分享的前端每周清单,为方便大家阅读,特整理一份索引。 王下邀月熊大大也于 2018 年 3 月 31 日整理了自己的前端每周清单系列,并以年/月为单位进行分类,具体内容看这里:前端每周清单年度总结与盘点。 前端每周清单第 56 期:D3 5.0,深入 React ...
分类:
其他好文 时间:
2020-05-03 20:29:19
阅读次数:
65
Thymeleaf和vue不是一类事务。 模板引擎:Thymeleaf、freemarker、JSP。 前端框架:vue、angularjs、react。 Thymeleaf是一个替代JSP的模板引擎。 使用Thymeleaf或其他模板的时候也可以使用前端框架。 现在github上很多工程就是spr ...
分类:
其他好文 时间:
2020-05-03 18:28:30
阅读次数:
390
We have the happy path covered for our post editor component, but what happens if there’s an error in saving the user’s information? We should probabl ...
分类:
数据库 时间:
2020-05-02 22:58:30
阅读次数:
81
Just make sure the date is in a range then it is fine import React from 'react' import {render, fireEvent, waitFor} from '@testing-library/react' impo ...
分类:
其他好文 时间:
2020-05-02 20:57:29
阅读次数:
56
A really important aspect of TDD is the refactor phase. A critical piece to making your tests easier to maintain is using code structure and values to ...
分类:
其他好文 时间:
2020-05-02 20:56:54
阅读次数:
83