React

  • Published on
    介绍了 React session 的实现方式,包括服务端支持的请求及封装的 AuthService.js,用高阶组件 withAuth 方便组件使用,还给出了登录页面 Login.js 等示例,灵感来自 react-with-styles 且建议用 next-with-auth 库更好。
  • Published on
    文章介绍 react native 中使用 protobufjs,需将 proto 文件转换为 json 载入,注意 lookupTypeOrEnum 查找 message 时 proto 中 enum 枚举类型会失败,还提到在不同系统降级 protobuf.js 版本的情况及相关代码片段。
  • Published on
    在 react native 中拷贝对象遇“One of the sources for assign has an enumerable key on the prototype chain”错误。for 循环给 obj 赋值放入数组,使用 _.clone 后正常,之前用 {...obj} 或 Object.assign({}, obj) 会报错,改用 lodash 的 clone 就没问题。
  • Published on
    Ant Design 是提升体验的中后台设计语言,react 首页渲染慢,按需加载的方法。
  • Published on
    分享 10 个 React 小模式,包括数据传递、修复 input 标签、绑定 ID、控制 CSS、动态组件等。还提及优化组件、别过早组件化、文本格式化组件、降低组件复杂度及正确导入组件等,希望对 React 初学者有帮助。