Time of Update: 2016-01-04
標籤:環境搭建: 1.安裝react-native開發環境 npm install -g react-native-cli 2.安裝jest測試環境 npm install -g jest-cli
Time of Update: 2016-01-03
標籤:1、文法上,根據生命週期方法執行的順序編寫代碼 (1
Time of Update: 2015-12-31
標籤:we leverage private components to break our render function into more manageable pieces without leaking the implementation details of our component. <!DOCTYPE html><html><head> <meta charset="utf-8"> <title>JS
Time of Update: 2016-03-30
標籤:最近接觸react架構,小記一下~~~開發環境配置要搭建一個現代的前端開發環境配套的工具有很多,比如 Grunt / Gulp / Webpack / Broccoli,都是要解決前端工程化問題,這個主題很大,這裡為了使用 React 我們只關注其中的兩個點: JSX 支援ES6 支援配合 webpack 非常方便。Webpack 配置 React
Time of Update: 2016-03-29
標籤:IndexRoute allows us to define a default child component to be rendered at a specific route when no other sub-route is available. When Home page display, we also make About component as default Route to dsiplay, only when use click Contact
Time of Update: 2016-03-28
標籤:1.React.renderToString 函數, 參數是組件,返回一個字串<!DOCTYPE html><html> <head> <title>React JS</title> <script src="../build_0.13/react.js"></script> <script
Time of Update: 2016-03-24
標籤:1.因為jsx將兩個花括弧之間的內容渲染為動態值,只需要引用對應的變數即可<!DOCTYPE html><html> <head> <title>React JS</title> <script src="../build_0.13/react.js"></script> <script
Time of Update: 2016-03-09
標籤:眼下React Native(以後簡稱RN)越來越火,我也要投入到學習當中。對於一個前端來說,還是有些難度。因為本人覺得這是一個App開發的領域,自然是不同。編寫本文的時候,RN的版本為0.21.0。我們馬上以代碼進入今天的學習。‘use strict‘;import React, { AppRegistry, Component, StyleSheet, Text, View} from ‘react-native‘;class Hello extends Component
Time of Update: 2016-03-06
標籤:React 起源於Facebook內部項目,是一個用來構建使用者介面的javascript庫,相當於MVC架構中的V層架構,與市面上其他架構不同的是,React 把每一個組件當成了一個狀態機器,組件內部通過state來維護組件狀態的變化,當組件的狀態發生變化時,React通過虛擬DOM技術來增量並且高效的更新真實DOM。本文將對React的這些特點進行簡單的介紹。 一個簡單的React組件 ——
Time of Update: 2016-02-27
標籤:基於React Native的Material
Time of Update: 2016-02-26
標籤:Origin1、React並不會通過String類型的Html片段產生DOM2、在componentWillReceiveProps中調用setState()不會觸發re-render3、componentWillUpdate中不能調用this.setState()4、在通過Ajax擷取到資料,調用this.setState()之前,應該通過this.isMounted()確定當前的component已經處在渲染完成的階段5、父組件到子組件通過props傳遞資料,子組件向父組件傳遞資料通過
Time of Update: 2016-02-24
標籤:安裝Xcode安裝Homebrew檢查是否有警告安裝Android SDK安裝flow和watchman安裝nodejs安裝react-native-cli安裝Genymotion安裝Webstorm 10建立React Native空項目使用Webstorm編輯JSX代碼檔案在iOS模擬器中運行在Android模擬器中運行安裝Xcode從App Store搜尋下載。需要Apple
Time of Update: 2016-02-23
標籤:<!DOCTYPE html><html> <head> <script src="../../build/react.js"></script> <script src="../../build/react-dom.js"></script> <script src="../../build/browser.min.js"></script>
Time of Update: 2016-02-22
標籤:1.build檔案介紹(1)react.js 是react的核心庫(2)react-dom.js 提供與DOM相關功能(3)browser.js 是將JSX文法轉為javascript文法 2.組件的繼續學習 注意:組件的第一個字母必須大寫,否則會報錯。組件的用法和html標籤完全一致,可以任意加入屬性。組件的屬性,可以通過 this.props 對象上擷取。 3.this.props.children this.props.
Time of Update: 2016-02-19
標籤:昨天初體驗了一把SVG一個並不是多麼複雜的動畫,我在iOS模擬器上體驗的是流暢的,但是在Android真機上體驗,還是比較卡的。下面來介紹一個OpenGL的第三方庫:下面是我啟動並執行裡面Demo的效果:至於如何使用者一個庫,文檔已經寫的很清楚啦,下面是網址:github:https://github.com/ProjectSeptemberInc/gl-react-native/文檔:https://projectseptemberinc.gitbooks.io/gl-react/con
Time of Update: 2016-02-01
標籤:教程目錄react+redux教程(一)connect、applyMiddleware、thunk、webpackHotMiddlewarereact+redux教程(二)redux的單一狀態樹完全替代了react的狀態機器?react+redux教程(三)reduce()、filter()、map()、some()、every()、...展開屬性react+redux教程(四)undo、devtools、routerreact+redux教程(五)非同步、單一state樹結構、compo
Time of Update: 2016-01-30
標籤:我有點想要吐槽,因為用原生的js實現起來挺簡單的一個小東西,改用react來寫卻花了我不少時間,也許react的寫法只有在複雜的web應用中才能體現出它的優勢吧!不過吐槽歸吐槽,對react這種優雅的代碼的寫法我自己是很喜歡的啊!來簡單的講一下,希望能對react的初學者有一些協助...:組建的編寫用了一些es6的文法,用webpack作為轉譯打包工具。把核心代碼貼上來下...var React=require("react");var
Time of Update: 2016-01-28
標籤:今天練習項目中需要給listview在載入圖片時增加一個淡入淡出的效果,因此乾脆就自己封裝了一個組件: 1 ‘use strict‘ 2 3 import React from ‘react-native‘ 4 5 var { 6 Animated, 7 PropTypes 8 } = React 9 10 class AniImage extends React.Component {11 static propTypes = {12 url:
Time of Update: 2016-01-22
標籤:react這麼熱門的架構也不介紹了,redux是一個單項資料流的小架構,當然不只配合react,它起初是為react而配的,現在面向所有了,比如ng-redux的項目。redux做為react的標準搭配,大有超越flux的勢頭。今天show一個例子來入門redux。源碼在此。 (本文預設你已有react基礎,es6基礎)這個效果很簡單就是一個count計數,+++++的按鈕按一下就會+1;input裡面寫什麼,submit就會alert什麼內容,這個demo很雜亂,是我修改的官方
Time of Update: 2016-01-18
標籤:此文章同步串連: https://github.com/p2227/p2227.github.io/issues/3# 初用react容易踩的坑## 自訂群組件忘記大寫第一個字母 ```javascriptvar myComp = React.createClass({ render: function() { return <div>Hello world</div>; }});ReactDOM.render(<myComp />,