SASS Bootstrap allows us to configure theme or branding variables that affect all components (e.g. Primary Color or Link Color). When we isolate our styles inside React components we lose the ability to theme them. To get round this we can put our th…
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 text in needless <span> or <div>, we will see how React 16 removes the unneeded structure. impo…
首先确认安装了node环境,Node >= 6. 如果对react 及 ant-design 一无所知,建议去阅读下api文档,react 可以在 codePen 在线练习. react Api中文文档     ant-design 中文文档 本人也是第一次接触react,对本教程如疑问,欢迎评论 或 发送至 15521285778@163.com 交流 1,全局安装Create React App , 创建项目 Create React App 是开始构建新的 React 单页应用程序的最佳方…
本文介绍的是react新特性react hooks,本文面向的是有一定react开发经验的小伙伴,如果你对react还不是很熟悉的话我建议你先学习react并多多联系. 首先我们都知道react有3种组件:分别是Function函数式无状态组件.class有状态组件.高阶组件.这里不对这3种组件做一一介绍. 本文重点是react hooks 一个最简单的Hooks 首先让我们看一下一个简单的有状态组件: class Example extends React.Component { constr…
Props & onChange 的原罪 .「props & onChange 接口规范」它不是一个典型的「程序接口规范」. 当你拿到一个可视组件的 ref,却没有类似 setProps() 这样的方法来改变其 props,你只能在 render() 方法中,通过 jsx 语言来设置其 props.这意味着父元素必须保存并维护这个 props 对应的值,而更多时候,父容器只是想一次性的设置一个值,然后就走,让以后的事情交给子元素自己去维护.当然,你也可以通过 ref 来获取子元素的应用,然…
1. JSX JSX是一种拥有描述UI的JavaScript扩展语法,React使用这种语法描述组件的UI. 1.1 基本语法 JSX可以嵌套多个HTML标签,可以使用大部分符号HTML规范的属性. TodoList.js: import React, { Component } from 'react' class TodoList extends Component { render(){ return ( <ul> <li>To Do</li> <li>…
闲暇之余,写了一个React Native的demo,可以作为大家的入门学习参考. GitHub:https://github.com/xujianfu/ElmApp.git GitHub:https://github.com/xujianfu/React-Native-CarProject.git 项目截图如下: 一.项目界面设计 1.React Navigation的应用  React Navigation 源于 React Native 社区对一个可扩展且易于使用的导航解决方案的需求,它完…
一.项目概况 基于react+react-dom+react-router-dom+redux+react-redux+webpack2.0+react-photoswipe+swiper等技术混合开发的手机端仿微信界面聊天室——reactChatRoom,实现了聊天记录下拉刷新.发送消息.表情(动图),图片.视频预览,打赏.红包等功能. 二.技术栈 MVVM框架:react / react-dom 状态管理:redux / react-redux 页面路由:react-router-dom 弹…
React中最重要的就是组件,写的更多的组件都是继承至 React.Component .大部分同学可能都会认为 Component 这个base class 给我们提供了各种各样的功能.他帮助我们去运行了这个 render function .然后最终把我们写在里面的 dom 标签或者子组件之类的渲染出来.渲染到我们的浏览器里面变成想要的页面的一个形式.在真正的看源码之前我也是这么认为的.但是看了源码之后发现他颠覆了我对他的一个认知. 在 React 当中不仅仅只有 Component 这一个…
Amit Ashwini - 09 SEPTEMBER 2017 React.js was developed by Facebook to address its need for a dynamic and high performing User Interface(UI). In 2011, Jordan Walke and his team from Facebook released the React JS library, a JavaScript library which b…