Using sublime 3 as the development ide-of react native

Source: Internet
Author: User
Tags sublime text



Turn-http://www.cnblogs.com/wangshuo1/p/react_native_02.html



Sublime Text is a code editor. It is also an advanced text editor for HTML and prose. Beautiful user interface and extraordinary features, such as: Mini map, multi-select Python plugin, code snippet and so on. Fully customizable key bindings, menus and toolbars, and more. Beautiful user interface and extraordinary features, Sublime text's main features include: Spell checker, bookmarks, full Python API, Goto feature, instant item switching, multiple selection, multi-window and more.


1. Download and install Sublime 3


Sublime 3 of:


http://WWW.SUBLIMETEXT.COM/3 


Choose the appropriate platform to download, and then install on the line. Here LZ selects the SUBLINETEXT3 under the Mac platform to install



1) Double-click Sublime Text Build 3.dmg






2) Drag subline Text.app to applications.


2. Install the package Control


The default sublime 3 does not have a package Control, which is used to install other plugins.



Simple installation method using CTRL + ' shortcut key or Open command line via view->show Console menu, paste the following code:


Import Urllib.request,os,hashlib; h =‘2915d1851351e5ee549c20394736b442' +‘8bc59f460fa1548d1514676163dafc88‘; PF =‘Package Control.sublime-package‘; IPP = Sublime.installed_packages_path (); Urllib.request.install_opener (Urllib.request.build_opener (Urllib.request.ProxyHandler ())); by = Urllib.request.urlopen ( http://packagecontrol.io/ + Pf.replace ( "  ',  ' %20read (); dh = hashlib.sha256 (by). Hexdigest (); print ( ' error validating Download ( Got%s instead of%s), please try manual install "% (DH, h)) if dh! = H else open (Os.path. Join (IPP, pf), wb). write (by)             


Or


import urllib.request,os; pf =  '  Package Control.sublime-packageopen (Os.path. Join (IPP, pf), wb). write (Urllib.request.urlopen (" http:// Sublime.wbond.net/ "+ pf.replace ( '   ' %20read ())             


Or the method provided by the official website:


https://packagecontrol.io/installation#st3  


If it goes well, you can now see the package settings and the package control two menus under the Preferences menu.


3. Install the required plugins


Installing sublime plug-ins is also a common use of sublime problems, the steps are as follows:
1) Open Sublime Text3, click "Preferences" and "Package Control" in the menu bar, or you can use the shortcut key Ctrl+shift+p Open
2) In the Open terminal window, enter "Install", below will be prompted "package Control:install", with the mouse click
3) Wait a few seconds at this time, will pop up a terminal, in the terminal input you want to install the plug-in, to find, click on the list below the plug-in, will automatically install for you
Some of the recommended plugins for React native development:


    • Reactjs: Support react development, code hints, highlighting
    • Emmet: Front-end development essentials.
    • Terminal: Open the terminal in sublime and navigate to the current directory, artifact, Mac shortcut keys are: command+shift+t

      In the modified page, click the right mouse button, as shown, select the last item to open the console.

    • Code snippet for React-native-snippets:react native
// The supported code snippets are as follows
cdm → componentDidMount: fn () {...}
cdup → componentDidUpdate: fn (pp, ps) {...}
cs → var cx = React.addons.classSet;
cwm → componentWillMount: fn () {...}
cwr → componentWillReceiveProps: fn (np) {...}
cwu → componentWillUpdate: fn (np, ns) {...}
cwun → componentWillUnmount: fn () {...}
cx → cx ({...})
fdn → React.findDOMNode (...)
fup → forceUpdate (...)
gdp → getDefaultProps: fn () {return {...}}
gis → getInitialState: fn () {return {...}}
ism → isMounted ()
props → this.props.
pt → propTypes {...}
rcc → component skeleton
refs → this.refs.
ren → render: fn () {return ...}
scu → shouldComponentUpdate: fn (np, ns) {...}
sst → this.setState ({...})
state → this.state. 





Other plugins can refer to here: http://segmentfault.com/a/1190000003698071



Choose some practical installation on the line.



Recommend a sublime material style theme: material, go directly to search this plugin can install, Introduction address: Here



After the installation:





4. Import the project


Click "Project"--"ADD Folder to Project" on the menu bar to select the project's directory and import the project.


5. Debug and run the project


Add the terminal plug-in, in the sublime, directly with the shortcut key command+shift+t, open the terminal, and then execute the following command to run the IOS application:


react-native Run-ios





Using sublime 3 as the development ide-of react native


Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.