(Use require to import the dependencies first, then create the components with reactTo create a dependent APP1,APP2,APP3 3 JSvar React=require (' React '); var head=React.createclass ({ render:function() { return ( Head } ) module.exports=head;Simple example creation is done, required react,
Install Webpack and load a simple react componentGlobal NPM Module Installation:NPM install-g WebpackInstalling Jsx-loaderNPM Install--save-dev Jsx-loaderDefault to use the current directory's own newly created webpack.config.js as the configuration fileModule.exports = { entry: [ './assets/js/entry.js ' ], output: { + '/assets/' , " /assets/", ' bundle.js ' }, modul
Material Design-style component library based on the react native. (For the Platform unified experience, currently only to support Android)
Official website http://mrn.js.org/
Github HTTPS://GITHUB.COM/BINGGG/MRN
Sample Application Online Demo https://appetize.io/app/j48zj9r83cetpd1mhg4g8buc4w
Sample app Download https://github.com/binggg/MaterialR
1.antd-mobile is an open source React component library by Ant Finance Team, which has a lot of components to use, let me introduce his usage:
2. According to the official website HTTP://BETA.MOBILE.ANT.DESIGN/DOCS/REACT/INTRODUCE-CN on the operation steps:
NPM Install Antd-mobile@next--save3. The Package.json file
our login react component. Next, we use react to create a class. In this case, a simple navigation bar appears in all of the subassemblies. We simply link to our routing: app and login. Then react route will be initialized by the Routehandler component.
In this app, we def
Previous we have a general understanding of react, before introducing the technical details, let us first look at the main tools for react development and module management Webpack. Called react development artifact a bit of a title party, but Webpack is really the most powe
React + Webpack construction and packaging optimization, reactwebpack
This article describes how to optimize React + Webpack construction and packaging. The details are as follows:
Use babel-react-optimize to optimize the React co
.?? This article is mainly to write a webpack development of the basic framework , the subsequent writing react simple example, build Bar command, index.html do not need to change, only need to pay attention to./APP/JSX the JSX code for the component in the directory.Source Address : Https://github.com/mqy1023/react-ba
Webpack 2 react development and configuration instance code, webpackreact
Based on the standard syntax of webpack 2.3, common configurations such as less variable replacement, hot loading of React components, separate output of the third library, and distinguishing productio
Compile React component project practice analysis and react component project
When I first started writing React, I saw many methods for writing components. There are one hundred writing methods in one hundred tutorials. Although React
This.state.counter} - in ); the }, the }); AboutExport {mycomponent};//Component output, (here is a digression, export is ES6 developed module loading mode, with import use, while exports is COMMONJS standard, and require and other use, their differences have the opportunity to open another article will)3, although the component is built, but the browser does not know this form of components, this ti
(
Other component code is not shown in detail.
This time we enter yarn run build and we can see that a bundle.js file is generated under build. If you type yarn run start , you can see the page.
Local input yarn start and then access http://localhost:9000 to see what you have written.
For more configuration on React-router, refer to the official documentation tutorial.
Iv. Release
We actua
) Start development/srcCreate a new App.js file in, with the following content:Import React from ' React '; class App extends React.component { render () { return export default App;index.jsafter emptying, write the following in it:Import React from ' React ', import reactdom from '
inline mode and change the dev-server.js.......New webpackdevserver (compiler, { /// default will provide the local server in the root folder, where the folder is specified inline:true // Auto Refresh hot:true // turn on Hot module replacement......Change Webpack.config.js......Const WEBPACK = require (' Webpack ');Module.exports = { ' cheap-module-eval-source-map ', entry: [ '
much meaning, then the overall technical direction is very clear: the implementation of the RN consistent style, Component and APIs are eventually compiled into the web version through the build tools.
Example
Let's take a look at the React Web project creation process:First step: Install the React Web and configure itThis step is primarily to install
: ' Style-loader!css-loader '},{test:/\.js$/, Loader: ' Jsx-loader?harmony '},{test:/\.scss$/, Loader: ' Style!css!sass?sourcemap '},{test:/\. (png|jpg) $/, loader: ' url-loader?limit=8192 '}]},2.4 Other configurationsResolve: {Automatic extension of the file suffix means that we can omit the suffix name from the Require moduleExtensions: [', '. js ', '. json ', '. Scss ']},2.5 first refer to the directory structure in the exampleBuild holds compiled files, SRC holds
This is the project I began to take over in the second half of 16, when I just learned react and webpack related things, here a little bit. Configure code directly This is the development configuration
var path = require (' path ');
var webpack = require (' Webpack ');
var openbrowserplugin = require (' Open-browser
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.