{"componentChunkName":"component---src-templates-docs-js","path":"/docs/how-to-contribute.html","result":{"data":{"markdownRemark":{"html":"<p>React 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 on <a href=\"https://www.facebook.com\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">facebook.com</a>. We’re still working out the kinks to make contributing to this project as easy and transparent as possible, but we’re not quite there yet. Hopefully this document makes the process for contributing clear and answers some questions that you may have.</p>\n<h3 id=\"code-of-conduct\"><a href=\"#code-of-conduct\" aria-hidden class=\"anchor\"><svg 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://github.com/facebook/react/blob/master/CODE_OF_CONDUCT.md\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Code of Conduct</a> </h3>\n<p>Facebook has adopted the <a href=\"https://www.contributor-covenant.org/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Contributor Covenant</a> as its Code of Conduct, and we expect project participants to adhere to it. Please read <a href=\"https://github.com/facebook/react/blob/master/CODE_OF_CONDUCT.md\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">the full text</a> so that you can understand what actions will and will not be tolerated.</p>\n<h3 id=\"open-development\"><a href=\"#open-development\" aria-hidden class=\"anchor\"><svg 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>Open Development </h3>\n<p>All work on React happens directly on <a href=\"https://github.com/facebook/react\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">GitHub</a>. Both core team members and external contributors send pull requests which go through the same review process.</p>\n<h3 id=\"semantic-versioning\"><a href=\"#semantic-versioning\" aria-hidden class=\"anchor\"><svg 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>Semantic Versioning </h3>\n<p>React follows <a href=\"https://semver.org/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">semantic versioning</a>. We release patch versions for critical bugfixes, minor versions for new features or non-essential changes, and major versions for any breaking changes. When we make breaking changes, we also introduce deprecation warnings in a minor version so that our users learn about the upcoming changes and migrate their code in advance. Learn more about our commitment to stability and incremental migration in <a href=\"/docs/faq-versioning.html\">our versioning policy</a>.</p>\n<p>Every significant change is documented in the <a href=\"https://github.com/facebook/react/blob/master/CHANGELOG.md\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">changelog file</a>.</p>\n<h3 id=\"branch-organization\"><a href=\"#branch-organization\" aria-hidden class=\"anchor\"><svg 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>\n<p>Submit all changes directly to the <a href=\"https://github.com/facebook/react/tree/master\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><code class=\"gatsby-code-text\">master branch</code></a>. We don’t use separate branches for development or for upcoming releases. We do our best to keep <code class=\"gatsby-code-text\">master</code> in good shape, with all tests passing.</p>\n<p>Code that lands in <code class=\"gatsby-code-text\">master</code> must be compatible with the latest stable release. It may contain additional features, but no breaking changes. We should be able to release a new minor version from the tip of <code class=\"gatsby-code-text\">master</code> at any time.</p>\n<h3 id=\"feature-flags\"><a href=\"#feature-flags\" aria-hidden class=\"anchor\"><svg 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>Feature Flags </h3>\n<p>To keep the <code class=\"gatsby-code-text\">master</code> branch in a releasable state, breaking changes and experimental features must be gated behind a feature flag.</p>\n<p>Feature flags are defined in <a href=\"https://github.com/facebook/react/blob/master/packages/shared/ReactFeatureFlags.js\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><code class=\"gatsby-code-text\">packages/shared/ReactFeatureFlags.js</code></a>. Some builds of React may enable different sets of feature flags; for example, the React Native build may be configured differently than React DOM. These flags are found in <a href=\"https://github.com/facebook/react/tree/master/packages/shared/forks\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><code class=\"gatsby-code-text\">packages/shared/forks</code></a>. Feature flags are statically typed by Flow, so you can run <code class=\"gatsby-code-text\">yarn flow</code> to confirm that you’ve updated all the necessary files.</p>\n<p>React’s build system will strip out disabled feature branches before publishing. A continuous integration job runs on every commit to check for changes in bundle size. You can use the change in size as a signal that a feature was gated correctly.</p>\n<h3 id=\"bugs\"><a href=\"#bugs\" aria-hidden class=\"anchor\"><svg 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 </h3>\n<h4 id=\"where-to-find-known-issues\"><a href=\"#where-to-find-known-issues\" aria-hidden class=\"anchor\"><svg 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>Where to Find Known Issues </h4>\n<p>We are using <a href=\"https://github.com/facebook/react/issues\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">GitHub Issues</a> for our public bugs. We keep a close eye on this and try to make it clear when we have an internal fix in progress. Before filing a new task, try to make sure your problem doesn’t already exist.</p>\n<h4 id=\"reporting-new-issues\"><a href=\"#reporting-new-issues\" aria-hidden class=\"anchor\"><svg 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 </h4>\n<p>The best way to get your bug fixed is to provide a reduced test case. This <a href=\"https://jsfiddle.net/Luktwrdm/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">JSFiddle template</a> is a great starting point.</p>\n<h4 id=\"security-bugs\"><a href=\"#security-bugs\" aria-hidden class=\"anchor\"><svg 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 </h4>\n<p>Facebook has a <a href=\"https://www.facebook.com/whitehat/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">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>\n<h3 id=\"how-to-get-in-touch\"><a href=\"#how-to-get-in-touch\" aria-hidden class=\"anchor\"><svg 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>How to Get in Touch </h3>\n<ul>\n<li>IRC: <a href=\"https://webchat.freenode.net/?channels=reactjs\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">#reactjs on freenode</a></li>\n<li><a href=\"/community/support.html#popular-discussion-forums\">Discussion forums</a></li>\n</ul>\n<p>There is also <a href=\"https://www.reactiflux.com/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">an active community of React users on the Discord chat platform</a> in case you need help with React.</p>\n<h3 id=\"proposing-a-change\"><a href=\"#proposing-a-change\" aria-hidden class=\"anchor\"><svg 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>\n<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/issues/new\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">filing an issue</a>. This lets us reach an agreement on your proposal before you put significant effort into it.</p>\n<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>\n<h3 id=\"your-first-pull-request\"><a href=\"#your-first-pull-request\" aria-hidden class=\"anchor\"><svg 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>\n<p>Working on your first Pull Request? You can learn how from this free video series:</p>\n<p><strong><a href=\"https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">How to Contribute to an Open Source Project on GitHub</a></strong></p>\n<p>To help you get your feet wet and get you familiar with our contribution process, we have a list of <strong><a href=\"https://github.com/facebook/react/issues?q=is:open+is:issue+label:%22good+first+issue%22\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">good first issues</a></strong> that contain bugs that have a relatively limited scope. This is a great place to get started.</p>\n<p>If you decide to fix an issue, please be sure to check the comment thread in case somebody is already working on a fix. If nobody is working on it at the moment, please leave a comment stating that you intend to work on it so other people don’t accidentally duplicate your effort.</p>\n<p>If somebody claims an issue but doesn’t follow up for more than two weeks, it’s fine to take it over but you should still leave a comment.</p>\n<h3 id=\"sending-a-pull-request\"><a href=\"#sending-a-pull-request\" aria-hidden class=\"anchor\"><svg 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>\n<p>The core team is monitoring for pull requests. We will review your pull request and either merge it, request changes to it, or close it with an explanation. For API changes we may need to fix our internal uses at Facebook.com, which could cause some delay. We’ll do our best to provide updates and feedback throughout the process.</p>\n<p><strong>Before submitting a pull request,</strong> please make sure the following is done:</p>\n<ol>\n<li>Fork <a href=\"https://github.com/facebook/react\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">the repository</a> and create your branch from <code class=\"gatsby-code-text\">master</code>.</li>\n<li>Run <code class=\"gatsby-code-text\">yarn</code> in the repository root.</li>\n<li>If you’ve fixed a bug or added code that should be tested, add tests!</li>\n<li>Ensure the test suite passes (<code class=\"gatsby-code-text\">yarn test</code>). Tip: <code class=\"gatsby-code-text\">yarn test --watch TestName</code> is helpful in development.</li>\n<li>Run <code class=\"gatsby-code-text\">yarn test-prod</code> to test in the production environment. It supports the same options as <code class=\"gatsby-code-text\">yarn test</code>.</li>\n<li>If you need a debugger, run <code class=\"gatsby-code-text\">yarn debug-test --watch TestName</code>, open <code class=\"gatsby-code-text\">chrome://inspect</code>, and press “Inspect”.</li>\n<li>Format your code with <a href=\"https://github.com/prettier/prettier\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">prettier</a> (<code class=\"gatsby-code-text\">yarn prettier</code>).</li>\n<li>Make sure your code lints (<code class=\"gatsby-code-text\">yarn lint</code>). Tip: <code class=\"gatsby-code-text\">yarn linc</code> to only check changed files.</li>\n<li>Run the <a href=\"https://flowtype.org/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Flow</a> typechecks (<code class=\"gatsby-code-text\">yarn flow</code>).</li>\n<li>If you haven’t already, complete the CLA.</li>\n</ol>\n<h3 id=\"contributor-license-agreement-cla\"><a href=\"#contributor-license-agreement-cla\" aria-hidden class=\"anchor\"><svg 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) </h3>\n<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, just let us know that you have completed the CLA and we can cross-check with your GitHub username.</p>\n<p><strong><a href=\"https://code.facebook.com/cla\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Complete your CLA here.</a></strong></p>\n<h3 id=\"contribution-prerequisites\"><a href=\"#contribution-prerequisites\" aria-hidden class=\"anchor\"><svg 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>Contribution Prerequisites </h3>\n<ul>\n<li>You have <a href=\"https://nodejs.org\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Node</a> installed at v8.0.0+ and <a href=\"https://yarnpkg.com/en/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Yarn</a> at v1.2.0+.</li>\n<li>You have <a href=\"https://www.oracle.com/technetwork/java/javase/downloads/index.html\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">JDK</a> installed.</li>\n<li>You have <code class=\"gatsby-code-text\">gcc</code> installed or are comfortable installing a compiler if needed. Some of our dependencies may require a compilation step. On OS X, the Xcode Command Line Tools will cover this. On Ubuntu, <code class=\"gatsby-code-text\">apt-get install build-essential</code> will install the required packages. Similar commands should work on other Linux distros. Windows will require some additional steps, see the <a href=\"https://github.com/nodejs/node-gyp#installation\" target=\"_blank\" rel=\"nofollow noopener noreferrer\"><code class=\"gatsby-code-text\">node-gyp</code> installation instructions</a> for details.</li>\n<li>You are familiar with Git.</li>\n</ul>\n<h3 id=\"development-workflow\"><a href=\"#development-workflow\" aria-hidden class=\"anchor\"><svg 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>Development Workflow </h3>\n<p>After cloning React, run <code class=\"gatsby-code-text\">yarn</code> to fetch its dependencies.\nThen, you can run several commands:</p>\n<ul>\n<li><code class=\"gatsby-code-text\">yarn lint</code> checks the code style.</li>\n<li><code class=\"gatsby-code-text\">yarn linc</code> is like <code class=\"gatsby-code-text\">yarn lint</code> but faster because it only checks files that differ in your branch.</li>\n<li><code class=\"gatsby-code-text\">yarn test</code> runs the complete test suite.</li>\n<li><code class=\"gatsby-code-text\">yarn test --watch</code> runs an interactive test watcher.</li>\n<li><code class=\"gatsby-code-text\">yarn test &lt;pattern&gt;</code> runs tests with matching filenames.</li>\n<li><code class=\"gatsby-code-text\">yarn test-prod</code> runs tests in the production environment. It supports all the same options as <code class=\"gatsby-code-text\">yarn test</code>.</li>\n<li><code class=\"gatsby-code-text\">yarn debug-test</code> is just like <code class=\"gatsby-code-text\">yarn test</code> but with a debugger. Open <code class=\"gatsby-code-text\">chrome://inspect</code> and press “Inspect”.</li>\n<li><code class=\"gatsby-code-text\">yarn flow</code> runs the <a href=\"https://flowtype.org/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Flow</a> typechecks.</li>\n<li><code class=\"gatsby-code-text\">yarn build</code> creates a <code class=\"gatsby-code-text\">build</code> folder with all the packages.</li>\n<li><code class=\"gatsby-code-text\">yarn build react/index,react-dom/index --type=UMD</code> creates UMD builds of just React and ReactDOM.</li>\n</ul>\n<p>We recommend running <code class=\"gatsby-code-text\">yarn test</code> (or its variations above) to make sure you don’t introduce any regressions as you work on your change. However it can be handy to try your build of React in a real project.</p>\n<p>First, run <code class=\"gatsby-code-text\">yarn build</code>. This will produce pre-built bundles in <code class=\"gatsby-code-text\">build</code> folder, as well as prepare npm packages inside <code class=\"gatsby-code-text\">build/packages</code>.</p>\n<p>The easiest way to try your changes is to run <code class=\"gatsby-code-text\">yarn build react/index,react-dom/index --type=UMD</code> and then open <code class=\"gatsby-code-text\">fixtures/packaging/babel-standalone/dev.html</code>. This file already uses <code class=\"gatsby-code-text\">react.development.js</code> from the <code class=\"gatsby-code-text\">build</code> folder so it will pick up your changes.</p>\n<p>If you want to try your changes in your existing React project, you may copy <code class=\"gatsby-code-text\">build/dist/react.development.js</code>, <code class=\"gatsby-code-text\">build/dist/react-dom.development.js</code>, or any other build products into your app and use them instead of the stable version. </p>\n<p>If your project uses React from npm, you may delete <code class=\"gatsby-code-text\">react</code> and <code class=\"gatsby-code-text\">react-dom</code> in its dependencies and use <code class=\"gatsby-code-text\">yarn link</code> to point them to your local <code class=\"gatsby-code-text\">build</code> folder. Note that <strong>instead of <code class=\"gatsby-code-text\">--type=UMD</code> you’ll want to pass <code class=\"gatsby-code-text\">--type=NODE</code> when building</strong>. You’ll also need to build the <code class=\"gatsby-code-text\">scheduler</code> package:</p>\n<div class=\"gatsby-highlight\" data-language=\"sh\"><pre class=\"gatsby-code-sh\"><code class=\"gatsby-code-sh\">cd ~/path_to_your_react_clone/\nyarn build react/index,react-dom/index,scheduler --type=NODE\n\ncd build/node_modules/react\nyarn link\ncd build/node_modules/react-dom\nyarn link\n\ncd ~/path/to/your/project\nyarn link react react-dom</code></pre></div>\n<p>Every time you run <code class=\"gatsby-code-text\">yarn build</code> in the React folder, the updated versions will appear in your project’s <code class=\"gatsby-code-text\">node_modules</code>. You can then rebuild your project to try your changes.</p>\n<p>If some package is still missing (e.g. maybe you use <code class=\"gatsby-code-text\">react-dom/server</code> in your project), you can always do a full build with <code class=\"gatsby-code-text\">yarn build</code>. Note that running <code class=\"gatsby-code-text\">yarn build</code> without options takes a long time.</p>\n<p>We still require that your pull request contains unit tests for any new functionality. This way we can ensure that we don’t break your code in the future.</p>\n<h3 id=\"style-guide\"><a href=\"#style-guide\" aria-hidden class=\"anchor\"><svg 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 </h3>\n<p>We use an automatic code formatter called <a href=\"https://prettier.io/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Prettier</a>.\nRun <code class=\"gatsby-code-text\">yarn prettier</code> after making any changes to the code.</p>\n<p>Then, our linter will catch most issues that may exist in your code.\nYou can check the status of your code styling by simply running <code class=\"gatsby-code-text\">yarn linc</code>.</p>\n<p>However, there are still some styles that the linter cannot pick up. If you are unsure about something, looking at <a href=\"https://github.com/airbnb/javascript\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Airbnb’s Style Guide</a> will guide you in the right direction.</p>\n<h3 id=\"request-for-comments-rfc\"><a href=\"#request-for-comments-rfc\" aria-hidden class=\"anchor\"><svg 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>Request for Comments (RFC) </h3>\n<p>Many changes, including bug fixes and documentation improvements can be implemented and reviewed via the normal GitHub pull request workflow.</p>\n<p>Some changes though are “substantial”, and we ask that these be put through a bit of a design process and produce a consensus among the React core team.</p>\n<p>The “RFC” (request for comments) process is intended to provide a consistent and controlled path for new features to enter the project. You can contribute by visiting the <a href=\"https://github.com/reactjs/rfcs\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">rfcs repository</a>.</p>\n<h3 id=\"license\"><a href=\"#license\" aria-hidden class=\"anchor\"><svg 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 </h3>\n<p>By contributing to React, you agree that your contributions will be licensed under its MIT license.</p>\n<h3 id=\"what-next\"><a href=\"#what-next\" aria-hidden class=\"anchor\"><svg 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 Next? </h3>\n<p>Read the <a href=\"/docs/codebase-overview.html\">next section</a> to learn how the codebase is organized.</p>","frontmatter":{"title":"How to Contribute","next":"codebase-overview.html","prev":null},"fields":{"path":"content/docs/how-to-contribute.md","slug":"docs/how-to-contribute.html"}}},"pageContext":{"slug":"docs/how-to-contribute.html"}},"staticQueryHashes":[]}