mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
4ca5c625fc
Deploy website version based on 517625198a
195 lines
52 KiB
HTML
195 lines
52 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>How to Contribute · React Native</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="React Native is one of Facebook's first open source projects that is both under very active development and is also being used to ship code to everybody using Facebook's mobile apps. If you're interested in contributing to React Native, hopefully this document makes the process for contributing clear."/><meta name="docsearch:version" content="0.5"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="How to Contribute · React Native"/><meta property="og:type" content="website"/><meta property="og:url" content="https://facebook.github.io/react-native/index.html"/><meta property="og:description" content="React Native is one of Facebook's first open source projects that is both under very active development and is also being used to ship code to everybody using Facebook's mobile apps. If you're interested in contributing to React Native, hopefully this document makes the process for contributing clear."/><meta name="twitter:card" content="summary"/><link rel="shortcut icon" href="/react-native/img/favicon.png"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/solarized-dark.min.css"/><link rel="alternate" type="application/atom+xml" href="https://facebook.github.io/react-native/blog/atom.xml" title="React Native Blog ATOM Feed"/><link rel="alternate" type="application/rss+xml" href="https://facebook.github.io/react-native/blog/feed.xml" title="React Native Blog RSS Feed"/><script>
|
||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
|
||
|
||
ga('create', 'UA-41298772-2', 'auto');
|
||
ga('send', 'pageview');
|
||
</script><script type="text/javascript" src="https://snack.expo.io/embed.js"></script><script type="text/javascript" src="/react-native/js/codeblocks.js"></script><link rel="stylesheet" href="/react-native/css/main.css"/></head><body class="sideNavVisible"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/react-native/"><img class="logo" src="/react-native/img/header_logo.png" alt="React Native"/><h2 class="headerTitleWithLogo">React Native</h2></a><a href="/react-native/versions"><h3>0.5</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/react-native/docs/0.5/getting-started" target="_self">Docs</a></li><li class=""><a href="/react-native/en/help" target="_self">Community</a></li><li class=""><a href="/react-native/blog" target="_self">Blog</a></li><li class="navSearchWrapper reactNavSearchWrapper"><input type="text" id="search_input_react" placeholder="Search" title="Search"/></li><li class=""><a href="https://github.com/facebook/react-native" target="_self">GitHub</a></li><li class=""><a href="https://reactjs.org/" target="_self">React</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i>›</i><span>Contributing</span></h2></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle">The Basics</h3><ul><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/getting-started">Getting Started</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/tutorial">Learn the Basics</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/props">Props</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/state">State</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/style">Style</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/height-and-width">Height and Width</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/flexbox">Layout with Flexbox</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/handling-text-input">Handling Text Input</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/handling-touches">Handling Touches</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/using-a-scrollview">Using a ScrollView</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/using-a-listview">Using List Views</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/network">Networking</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/more-resources">More Resources</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Guides</h3><ul><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/components-and-apis">Components and APIs</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/platform-specific-code">Platform Specific Code</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/navigation">Navigating Between Screens</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/images">Images</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/animations">Animations</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/accessibility">Accessibility</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/improvingux">Improving User Experience</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/timers">Timers</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/debugging">Debugging</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/performance">Performance</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/gesture-responder-system">Gesture Responder System</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/javascript-environment">JavaScript Environment</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/direct-manipulation">Direct Manipulation</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/colors">Color Reference</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/integration-with-existing-apps">Integration with Existing Apps</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/running-on-device">Running On Device</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/upgrading">Upgrading to new React Native versions</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/troubleshooting">Troubleshooting</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/native-modules-setup">Native Modules Setup</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Guides (iOS)</h3><ul><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/native-modules-ios">Native Modules</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/native-components-ios">Native UI Components</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/linking-libraries-ios">Linking Libraries</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/running-on-simulator-ios">Running On Simulator</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/communication-ios">Communication between native and React Native</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/building-for-apple-tv">Building For TV Devices</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/app-extensions">App Extensions</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Guides (Android)</h3><ul><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/native-modules-android">Native Modules</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/native-components-android">Native UI Components</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/headless-js-android">Headless JS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/signed-apk-android">Generating Signed APK</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/removing-default-permissions">Removing Default Permissions</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Contributing</h3><ul><li class="navListItem navListItemActive"><a class="navItem" href="/react-native/docs/0.5/contributing">How to Contribute</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/maintainers">What to Expect from Maintainers</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/building-from-source">Building React Native from source</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/testing">Testing your Changes</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/understanding-cli">Understanding the CLI</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">Components</h3><ul><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/datepickerios">DatePickerIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/image">Image</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/navigator">Navigator (Legacy Custom Component)</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/navigatorios">NavigatorIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/scrollview">ScrollView</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/segmentedcontrolios">SegmentedControlIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/tabbarios">TabBarIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/tabbarios-item">TabBarIOS.Item</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/text">Text</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/textinput">TextInput</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/touchablehighlight">TouchableHighlight</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/touchableopacity">TouchableOpacity</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/touchablewithoutfeedback">TouchableWithoutFeedback</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/webview">WebView</a></li></ul></div><div class="navGroup"><h3 class="navGroupCategoryTitle">APIs</h3><ul><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/actionsheetios">ActionSheetIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/cameraroll">CameraRoll</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/dimensions">Dimensions</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/geolocation">Geolocation</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/image-style-props">Image Style Props</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/interactionmanager">InteractionManager</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/layout-props">Layout Props</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/netinfo">NetInfo</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/pixelratio">PixelRatio</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/pushnotificationios">PushNotificationIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/settings">Settings</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/statusbarios">StatusBarIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/stylesheet">StyleSheet</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/text-style-props">Text Style Props</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/transforms">Transforms</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/vibrationios">VibrationIOS</a></li><li class="navListItem"><a class="navItem" href="/react-native/docs/0.5/view-style-props">View Style Props</a></li></ul></div></div></section></div><script>
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
|
||
createToggler('#tocToggler', 'body', 'tocActive');
|
||
|
||
const headings = document.querySelector('.toc-headings');
|
||
headings && headings.addEventListener('click', function(event) {
|
||
if (event.target.tagName === 'A') {
|
||
document.body.classList.remove('tocActive');
|
||
}
|
||
}, false);
|
||
|
||
function createToggler(togglerSelector, targetSelector, className) {
|
||
var toggler = document.querySelector(togglerSelector);
|
||
var target = document.querySelector(targetSelector);
|
||
|
||
toggler.onclick = function(event) {
|
||
event.preventDefault();
|
||
|
||
target.classList.toggle(className);
|
||
};
|
||
}
|
||
});
|
||
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><a class="edit-page-link button" href="https://github.com/facebook/react-native-website/blob/master/docs/contributing.md" target="_blank" rel="noreferrer noopener">Edit</a><h1 class="postHeaderTitle">How to Contribute</h1></header><article><div><span><p>React Native is one of Facebook's first open source projects that is both under very active development and is also being used to ship code to everybody using Facebook's mobile apps. If you're interested in contributing to React Native, hopefully this document makes the process for contributing clear.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="code-of-conduct-https-codefbcom-codeofconduct"></a><a href="#code-of-conduct-https-codefbcom-codeofconduct" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a><a href="https://code.fb.com/codeofconduct/">Code of Conduct</a></h2>
|
||
<p>Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read <a href="https://code.fb.com/codeofconduct/">the full text</a> so that you can understand what actions will and will not be tolerated.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="get-involved"></a><a href="#get-involved" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Get involved</h2>
|
||
<p>There are many ways to contribute to React Native, and many of them do not involve writing any code. Here's a few ideas to get started:</p>
|
||
<ul>
|
||
<li>Simply start using React Native. Go through the <a href="http://facebook.github.io/react-native/docs/getting-started.html">Getting Started</a> guide. Does everything work as expected? If not, we're always looking for improvements. Let us know by <a href="http://facebook.github.io/react-native/docs/contributing.html#reporting-new-issues">opening an issue</a>.</li>
|
||
<li>Look through the <a href="https://github.com/facebook/react-native/issues">open issues</a>. Provide workarounds, ask for clarification, or suggest labels. Help <a href="http://facebook.github.io/react-native/docs/contributing.html#triaging-issues-and-pull-requests">triage issues</a>.</li>
|
||
<li>If you find an issue you would like to fix, <a href="http://facebook.github.io/react-native/docs/contributing.html#your-first-pull-request">open a pull request</a>. Issues tagged as <a href="https://github.com/facebook/react-native/labels/Good%20first%20issue"><em>Good first issue</em></a> are a good place to get started.</li>
|
||
<li>Read through the <a href="http://facebook.github.io/react-native/">React Native docs</a>. If you find anything that is confusing or can be improved, you can make edits by clicking "Edit" at the top of most docs.</li>
|
||
<li>Browse <a href="https://stackoverflow.com/questions/tagged/react-native">Stack Overflow</a> and answer questions. This will help you get familiarized with common pitfalls or misunderstandings, which can be useful when contributing updates to the documentation.</li>
|
||
<li>Take a look at the <a href="https://react-native.canny.io/feature-requests">features requested</a> by others in the community and consider opening a pull request if you see something you want to work on.</li>
|
||
<li>Before opening your pull request, make sure you have fully tested your changes. Test your changes locally and by running the various tests provided.</li>
|
||
<li>For information on how to build the React Native project locally with your changes, make sure to read through the <a href="https://facebook.github.io/react-native/docs/building-from-source.html">Building React Native from source guide</a>.</li>
|
||
<li>Check out the <a href="https://facebook.github.io/react-native/docs/testing.html">Testing your changes guide</a> to find out about the numerous tests which has been provided to help ensure that any new changes wont cause a regression.</li>
|
||
</ul>
|
||
<p>Contributions are very welcome. If you think you need help planning your contribution, please hop into <a href="https://discord.gg/0ZcbPKXt5bZjGY5n">#react-native</a> and let people know you're looking for a mentor.</p>
|
||
<p>Core contributors to React Native meet monthly and post their meeting notes on the <a href="https://facebook.github.io/react-native/blog">React Native blog</a>. You can also find ad hoc discussions at <a href="https://discuss.reactjs.org/">https://discuss.reactjs.org/</a>.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="triaging-issues-and-pull-requests"></a><a href="#triaging-issues-and-pull-requests" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Triaging issues and pull requests</h3>
|
||
<p>One great way you can contribute to the project without writing any code is to help triage issues and pull requests as they come in.</p>
|
||
<ul>
|
||
<li>Ask for more information if the issue does not provide all the details required by the template.</li>
|
||
<li>Suggest <a href="https://github.com/facebook/react-native/labels">labels</a> that can help categorize issues.</li>
|
||
<li>Flag issues that are stale or that should be closed.</li>
|
||
<li>Ask for test plans and review code.</li>
|
||
</ul>
|
||
<p>You can learn more about handling issues in the <a href="maintainers.html#handling-issues">maintainer's guide</a>.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="our-development-process"></a><a href="#our-development-process" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Our development process</h2>
|
||
<p>The <a href="https://github.com/facebook/react-native"><code>facebook/react-native</code></a> repository on GitHub contains a mirror of the React Native library used internally at Facebook. The GitHub repository is linked to Facebook's internal source control, and all changes made to the internal React Native project <a href="https://github.com/facebook/react-native/commits/master">get synced to the <code>master</code> branch on GitHub</a> on an ongoing basis. Having Facebook's internal source control serve as the source of truth allows engineers at Facebook outside of the React Native team to move fast and contritube from an environment they are comfortable in.</p>
|
||
<p>React Native is also contributed to by a core team of engineers from several companies outside of Facebook, as well as many other open source <a href="https://github.com/facebook/react-native/graphs/contributors">contributors</a>. The core team coordinates open source releases through the <a href="https://github.com/react-native-community/react-native-releases"><code>react-native-releases</code></a> repository on GitHub.</p>
|
||
<p>When a change made on GitHub is approved, it will first be imported into Facebook's internal source control. The change will eventually sync back to GitHub as a single commit once it has passed all internal tests.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="branch-organization"></a><a href="#branch-organization" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Branch organization</h3>
|
||
<p>We will do our best to keep <code>master</code> in good shape, with tests passing at all times. But in order to move fast, we will make API changes that your application might not be compatible with. We will do our best to <a href="https://github.com/facebook/react-native/releases">communicate these changes</a> and version appropriately so you can lock into a specific version if need be.</p>
|
||
<p>To see what changes are coming and provide better feedback to React Native contributors, use the <a href="http://facebook.github.io/react-native/versions.html">latest release candidate</a> when possible. By the time a release candidate is released, the changes it contains will have been shipped in production Facebook apps for over two weeks.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="bugs"></a><a href="#bugs" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Bugs</h2>
|
||
<p>We use <a href="https://github.com/facebook/react-native/issues">GitHub Issues</a> for our public bugs. If you would like to report a problem, take a look around and see if someone already opened an issue about it. If you are certain this is a new, unreported bug, you can submit a <a href="http://facebook.github.io/react-native/docs/contributing.html#reporting-new-issues">bug report</a>.</p>
|
||
<p>If you have questions about using React Native, the <a href="http://facebook.github.io/react-native/help.html">Community page</a> list various resources that should help you get started.</p>
|
||
<p>We also have a <a href="https://react-native.canny.io/feature-requests">place where you can request features or enhancements</a>. If you see anything you'd like to be implemented, vote it up and explain your use case.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="reporting-new-issues"></a><a href="#reporting-new-issues" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Reporting new issues</h2>
|
||
<p>When <a href="https://github.com/facebook/react-native/issues/new">opening a new issue</a>, always make sure to fill out the <a href="https://raw.githubusercontent.com/facebook/react-native/master/.github/ISSUE_TEMPLATE.md">issue template</a>. <strong>This step is very important!</strong> Not doing so may result in your issue getting closed. Don't take this personally if this happens, and feel free to open a new issue once you've gathered all the information required by the template.</p>
|
||
<ul>
|
||
<li><strong>One issue, one bug:</strong> Please report a single bug per issue.</li>
|
||
<li><strong>Provide a Snack:</strong> The best way to get attention on your issue is to provide a reduced test case. You can use <a href="https://snack.expo.io/">Snack</a> to demonstrate the issue.</li>
|
||
<li><strong>Provide reproduction steps:</strong> List all the steps necessary to reproduce the issue. Provide a Snack or upload a sample project to GitHub. The person reading your bug report should be able to follow these steps to reproduce your issue with minimal effort.</li>
|
||
<li><strong>Try out the latest version:</strong> Verify that the issue can be reproduced locally by updating your project to use <a href="http://facebook.github.io/react-native/versions.html">React Native from <code>master</code></a>. The bug may have already been fixed!</li>
|
||
</ul>
|
||
<p>We're not able to provide support through GitHub Issues. If you're looking for help with your code, consider asking on <a href="http://stackoverflow.com/questions/tagged/react-native">Stack Overflow</a> or reaching out to the community through <a href="https://facebook.github.io/react-native/help.html">other channels</a>.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="security-bugs"></a><a href="#security-bugs" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Security bugs</h3>
|
||
<p>Facebook has a <a href="https://www.facebook.com/whitehat/">bounty program</a> for the safe disclosure of security bugs. With that in mind, please do not file public issues; go through the process outlined on that page.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="pull-requests"></a><a href="#pull-requests" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Pull requests</h2>
|
||
<h3><a class="anchor" aria-hidden="true" id="your-first-pull-request"></a><a href="#your-first-pull-request" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Your first pull request</h3>
|
||
<p>So you have decided to contribute code back to upstream by opening a pull request. You've invested a good chunk of time, and we appreciate it. We will do our best to work with you and get the PR looked at.</p>
|
||
<p>Working on your first Pull Request? You can learn how from this free video series:</p>
|
||
<p><a href="https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github"><strong>How to Contribute to an Open Source Project on GitHub</strong></a></p>
|
||
<p>We have a list of <a href="https://github.com/facebook/react-native/labels/Good%20first%20issue">beginner friendly issues</a> to help you get your feet wet in the React Native codebase and familiar with our contribution process. This is a great place to get started.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="proposing-a-change"></a><a href="#proposing-a-change" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Proposing a change</h3>
|
||
<p>If you would like to request a new feature or enhancement but are not yet thinking about opening a pull request, we have a <a href="https://react-native.canny.io/feature-requests">place to track feature requests</a>.</p>
|
||
<p>If you intend to change the public API, or make any non-trivial changes to the implementation, we recommend <a href="https://github.com/facebook/react-native/issues/new?title=%5BProposal%5D">filing an issue</a> that includes <code>[Proposal]</code> in the title. This lets us reach an agreement on your proposal before you put significant effort into it. These types of issues should be rare. If you have been contributing to the project long enough, you will probably already have access to the <a href="https://www.facebook.com/groups/reactnativeoss/">React Native Core Contributors</a> Facebook Group, where this sort of discussion is usually held.</p>
|
||
<p>If you're only fixing a bug, it's fine to submit a pull request right away but we still recommend to file an issue detailing what you're fixing. This is helpful in case we don't accept that specific fix but want to keep track of the issue.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="sending-a-pull-request"></a><a href="#sending-a-pull-request" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Sending a pull request</h3>
|
||
<p>Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.</p>
|
||
<p>Please make sure the following is done when submitting a pull request:</p>
|
||
<ol>
|
||
<li>Fork <a href="https://github.com/facebook/react-native">the repository</a> and create your branch from <code>master</code>.</li>
|
||
<li>Add the copyright notice to the top of any new files you've added.</li>
|
||
<li>Describe your <a href="contributing.html#test-plan"><strong>test plan</strong></a> in your pull request description. Make sure to <a href="testing.html">test your changes</a>!</li>
|
||
<li>Make sure your code lints (<code>npm run lint</code>).</li>
|
||
<li>If you haven't already, <a href="https://code.facebook.com/cla">sign the CLA</a>.</li>
|
||
</ol>
|
||
<p>All pull requests should be opened against the <code>master</code> branch. After opening your pull request, ensure <a href="contributing.html#contrinuous-integration-tests"><strong>all tests pass</strong></a> on Circle CI. If a test fails and you believe it is unrelated to your change, leave a comment on the pull request explaining why.</p>
|
||
<blockquote>
|
||
<p><strong>Note:</strong> It is not necessary to keep clicking <code>Merge master to your branch</code> on the PR page. You would want to merge master if there are conflicts or tests are failing. The Facebook-GitHub-Bot ultimately squashes all commits to a single one before merging your PR.</p>
|
||
</blockquote>
|
||
<h4><a class="anchor" aria-hidden="true" id="test-plan"></a><a href="#test-plan" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Test plan</h4>
|
||
<p>A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website.</p>
|
||
<ul>
|
||
<li>If you've added code that should be tested, add tests!</li>
|
||
<li>If you've changed APIs, update the documentation via an additional PR to the <a href="https://github.com/facebook/react-native-website">react-native-website</a> repo.</li>
|
||
<li>If you've updated the docs, verify the website locally and submit screenshots if applicable (see the <a href="https://github.com/facebook/react-native-website">react-native-website</a> README).</li>
|
||
</ul>
|
||
<p>See <a href="https://medium.com/@martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9">What is a Test Plan?</a> to learn more.</p>
|
||
<h4><a class="anchor" aria-hidden="true" id="continuous-integration-tests"></a><a href="#continuous-integration-tests" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Continuous integration tests</h4>
|
||
<p>Make sure all <strong>tests pass</strong> on <a href="http://circleci.com/gh/facebook/react-native">Circle CI</a>. PRs that break tests are unlikely to be merged. Learn more about <a href="testing.html">testing your changes here</a>.</p>
|
||
<h4><a class="anchor" aria-hidden="true" id="breaking-changes"></a><a href="#breaking-changes" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Breaking changes</h4>
|
||
<p>When adding a new breaking change, follow this template in your pull request:</p>
|
||
<pre><code class="hljs"><span class="hljs-section">### New breaking change here</span>
|
||
|
||
<span class="hljs-bullet">* </span><span class="hljs-strong">**Who does this affect**</span>:
|
||
<span class="hljs-bullet">* </span><span class="hljs-strong">**How to migrate**</span>:
|
||
<span class="hljs-bullet">* </span><span class="hljs-strong">**Why make this breaking change**</span>:
|
||
<span class="hljs-bullet">* </span><span class="hljs-strong">**Severity (number of people affected x effort)**</span>:
|
||
</code></pre>
|
||
<p>If your pull request is merged, a core contributor will update the <a href="https://github.com/facebook/react-native/wiki/Breaking-Changes">list of breaking changes</a> which is then used to populate the release notes.</p>
|
||
<h4><a class="anchor" aria-hidden="true" id="copyright-notice-for-files"></a><a href="#copyright-notice-for-files" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Copyright Notice for files</h4>
|
||
<p>Copy and paste this to the top of your new file(s):</p>
|
||
<pre><code class="hljs css languages- javascript"><span class="hljs-comment">/**
|
||
* Copyright (c) 2015-present, Facebook, Inc.
|
||
*
|
||
* This source code is licensed under the MIT license found in the
|
||
* LICENSE file in the root directory of this source tree.
|
||
*/</span>
|
||
</code></pre>
|
||
<p>If you've added a new module, add a <code>@providesModule <moduleName></code> at the end of the comment. This will allow the haste package manager to find it.</p>
|
||
<h4><a class="anchor" aria-hidden="true" id="contributor-license-agreement-cla"></a><a href="#contributor-license-agreement-cla" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Contributor License Agreement (CLA)</h4>
|
||
<p>In order to accept your pull request, we need you to submit a CLA. You only need to do this once, so if you've done this for another Facebook open source project, you're good to go. If you are submitting a pull request for the first time, the Facebook GitHub Bot will reply with a link to the CLA form. You may also <a href="https://code.facebook.com/cla">complete your CLA here</a>.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="what-happens-next"></a><a href="#what-happens-next" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>What happens next?</h3>
|
||
<p>The core team will be monitoring for pull requests. Read <a href="maintainers.html#handling-pull-requests">what to expect from maintainers</a> to understand what may happen after you open a pull request.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="style-guide"></a><a href="#style-guide" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Style Guide</h2>
|
||
<p>Our linter will catch most styling issues that may exist in your code. You can check the status of your code styling by simply running <code>npm run lint</code>.</p>
|
||
<p>However, there are still some styles that the linter cannot pick up.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="code-conventions"></a><a href="#code-conventions" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Code Conventions</h3>
|
||
<h4><a class="anchor" aria-hidden="true" id="general"></a><a href="#general" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>General</h4>
|
||
<ul>
|
||
<li><strong>Most important: Look around.</strong> Match the style you see used in the rest of the project. This includes formatting, naming things in code, naming things in documentation.</li>
|
||
<li>Add trailing commas,</li>
|
||
<li>2 spaces for indentation (no tabs)</li>
|
||
<li>"Attractive"</li>
|
||
</ul>
|
||
<h4><a class="anchor" aria-hidden="true" id="javascript"></a><a href="#javascript" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>JavaScript</h4>
|
||
<ul>
|
||
<li>Use semicolons;</li>
|
||
<li>ES6 standards</li>
|
||
<li>Prefer <code>'</code> over <code>"</code></li>
|
||
<li>Do not use the optional parameters of <code>setTimeout</code> and <code>setInterval</code></li>
|
||
<li>80 character line length</li>
|
||
</ul>
|
||
<h4><a class="anchor" aria-hidden="true" id="jsx"></a><a href="#jsx" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>JSX</h4>
|
||
<ul>
|
||
<li>Prefer <code>"</code> over <code>'</code> for string literal props</li>
|
||
<li>When wrapping opening tags over multiple lines, place one prop per line</li>
|
||
<li><code>{}</code> of props should hug their values (no spaces)</li>
|
||
<li>Place the closing <code>></code> of opening tags on the same line as the last prop</li>
|
||
<li>Place the closing <code>/></code> of self-closing tags on their own line and left-align them with the opening <code><</code></li>
|
||
</ul>
|
||
<h4><a class="anchor" aria-hidden="true" id="objective-c"></a><a href="#objective-c" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Objective-C</h4>
|
||
<ul>
|
||
<li>Space after <code>@property</code> declarations</li>
|
||
<li>Brackets on <em>every</em> <code>if</code>, on the <em>same</em> line</li>
|
||
<li><code>- method</code>, <code>@interface</code>, and <code>@implementation</code> brackets on the following line</li>
|
||
<li><em>Try</em> to keep it around 80 characters line length (sometimes it's just not possible...)</li>
|
||
<li><code>*</code> operator goes with the variable name (e.g. <code>NSObject *variableName;</code>)</li>
|
||
</ul>
|
||
<h4><a class="anchor" aria-hidden="true" id="java"></a><a href="#java" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Java</h4>
|
||
<ul>
|
||
<li>If a method call spans multiple lines closing bracket is on the same line as the last argument.</li>
|
||
<li>If a method header doesn't fit on one line each argument goes on a separate line.</li>
|
||
<li>100 character line length</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="documentation"></a><a href="#documentation" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Documentation</h3>
|
||
<ul>
|
||
<li>Do not wrap lines at 80 characters - configure your editor to soft-wrap when editing documentation.</li>
|
||
</ul>
|
||
<h2><a class="anchor" aria-hidden="true" id="license"></a><a href="#license" aria-hidden="true" class="hash-link"><svg class="hash-link-icon" aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>License</h2>
|
||
<p>By contributing to React Native, you agree that your contributions will be licensed under its BSD license.</p>
|
||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="/react-native/docs/0.5/removing-default-permissions">← Removing Default Permissions</a><a class="docs-next button" href="/react-native/docs/0.5/maintainers">What to Expect from Maintainers →</a></div></div></div></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/react-native/" class="nav-home"><img src="/react-native/img/header_logo.png" alt="React Native" width="66" height="58"/></a><div><h5><a href="/react-native/docs/getting-started.html">Docs</a></h5><a href="/react-native/docs/getting-started.html">Getting Started</a><a href="/react-native/docs/tutorial.html">Tutorial</a><a href="/react-native/docs/components-and-apis.html">Components and APIs</a><a href="/react-native/docs/more-resources.html">More Resources</a></div><div><h5><a href="/react-native/help.html">Community</a></h5><a href="/react-native/showcase.html">Who's using React Native?</a><a href="http://stackoverflow.com/questions/tagged/react-native" target="_blank">Stack Overflow</a><a href="https://discuss.reactjs.org" target="_blank">Discussion Forum</a><a href="https://discord.gg/0ZcbPKXt5bZjGY5n">Reactiflux Chat</a></div><div><h5>More</h5><a href="/react-native/blog">Blog</a><a href="https://twitter.com/reactnative" target="_blank">Twitter</a><a href="https://github.com/facebook/react-native" target="_blank">GitHub</a><a href="http://reactjs.org" target="_blank">React</a></div></section><a href="https://code.facebook.com/projects/" target="_blank" class="fbOpenSource"><img src="/react-native/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright">Copyright © 2018 Facebook Inc.</section></footer></div><script type="text/javascript" src="https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"></script><script>window.fbAsyncInit = function() {FB.init({appId:'1677033832619985',xfbml:true,version:'v2.7'});};(function(d, s, id){var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) {return;}js = d.createElement(s); js.id = id;js.src = '//connect.facebook.net/en_US/sdk.js';fjs.parentNode.insertBefore(js, fjs);}(document, 'script','facebook-jssdk'));
|
||
</script><script>window.twttr=(function(d,s, id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src='https://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js, fjs);t._e = [];t.ready = function(f) {t._e.push(f);};return t;}(document, 'script', 'twitter-wjs'));</script><script>
|
||
var search = docsearch({
|
||
|
||
apiKey: '2c98749b4a1e588efec53b2acec13025',
|
||
indexName: 'react-native-versions',
|
||
inputSelector: '#search_input_react',
|
||
algoliaOptions: {"facetFilters":["tags:0.5"],"hitsPerPage":5}
|
||
});
|
||
</script></body></html> |