mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
63533dd30d
Deploy website version based on 67c3e83c93e25daad08df01230fd7be7daf86671
670 lines
129 KiB
HTML
670 lines
129 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>Blog · React Native</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta name="description" content="A framework for building native apps using React"/><meta name="docsearch:language" content="en"/><meta property="og:title" content="Blog · React Native"/><meta property="og:type" content="website"/><meta property="og:url" content="https://facebook.github.io/react-native/"/><meta property="og:description" content="A framework for building native apps using React"/><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><script src="https://unpkg.com/vanilla-back-to-top@7.1.14/dist/vanilla-back-to-top.min.js"></script><script>
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
addBackToTop(
|
||
{"zIndex":100}
|
||
)
|
||
});
|
||
</script><script src="/react-native/js/scrollSpy.js"></script><link rel="stylesheet" href="/react-native/css/prism.css"/><link rel="stylesheet" href="/react-native/css/main.css"/><script src="/react-native/js/codetabs.js"></script></head><body class="blog"><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.59</h3></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class=""><a href="/react-native/docs/0.59/getting-started" target="_self">Docs</a></li><li class=""><a href="/react-native/docs/0.59/activityindicator" target="_self">API</a></li><li class=""><a href="/react-native/help" target="_self">Community</a></li><li class="siteNavGroupActive siteNavItemActive"><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></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"><div class="hamburger-menu"><div class="line1"></div><div class="line2"></div><div class="line3"></div></div></div><h2><i>›</i><span>All Blog Posts</span></h2></div><div class="navGroups"><div class="navGroup"><h3 class="navGroupCategoryTitle">All Blog Posts</h3><ul class=""><li class="navListItem"><a class="navItem" href="/react-native/blog/2019/06/12/react-native-open-source-update">React Native Open Source Update June 2019</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2019/05/01/react-native-at-f8-and-podcast">React Native at F8 and Open Source Podcast</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2019/03/12/releasing-react-native-059">Releasing React Native 0.59</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2019/03/01/react-native-open-source-update">React Native Open Source Update March 2019</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2019/01/07/state-of-react-native-community">The State of the React Native Community in 2018</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2018/11/01/oss-roadmap">Open Source Roadmap</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2018/08/27/wkwebview">Introducing new iOS WebViews</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2018/08/13/react-native-accessibility-updates">Accessibility API Updates</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2018/07/04/releasing-react-native-056">Releasing 0.56</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2018/06/14/state-of-react-native-2018">State of React Native 2018</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2018/05/07/using-typescript-with-react-native">Using TypeScript with React Native</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2018/04/09/build-com-app">Built with React Native - The Build.com app</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2018/03/22/building-input-accessory-view-for-react-native">Building <InputAccessoryView> For React Native</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2018/03/05/AWS-app-sync">Using AWS with React Native</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2018/01/18/implementing-twitters-app-loading-animation-in-react-native">Implementing Twitter’s App Loading Animation in React Native</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2018/01/09/react-native-monthly-6">React Native Monthly #6</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2017/11/06/react-native-monthly-5">React Native Monthly #5</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2017/09/21/react-native-monthly-4">React Native Monthly #4</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2017/08/30/react-native-monthly-3">React Native Monthly #3</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2017/08/07/react-native-performance-in-marketplace">React Native Performance in Marketplace</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2017/07/28/react-native-monthly-2">React Native Monthly #2</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2017/06/21/react-native-monthly-1">React Native Monthly #1</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2017/03/13/idx-the-existential-function">idx: The Existential Function</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2017/03/13/better-list-views">Better List Views in React Native</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2017/03/13/introducing-create-react-native-app">Introducing Create React Native App</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2017/02/14/using-native-driver-for-animated">Using Native Driver for Animated</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2017/01/07/monthly-release-cadence">A Monthly Release Cadence: Releasing December and January RC</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2016/12/05/easier-upgrades">Easier Upgrades Thanks to Git</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2016/11/08/introducing-button-yarn-and-a-public-roadmap">Introducing Button, Faster Installs with Yarn, and a Public Roadmap</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2016/10/25/0.36-headless-js-the-keyboard-api-and-more">0.36: Headless JS, the Keyboard API, & more</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2016/09/08/exponent-talks-unraveling-navigation">Expo Talks: Adam on Unraveling Navigation</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2016/08/19/right-to-left-support-for-react-native-apps">Right-to-Left Layout Support For React Native Apps</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2016/08/12/react-native-meetup-san-francisco">San Francisco Meetup Recap</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2016/07/06/toward-better-documentation">Toward Better Documentation</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2016/04/13/react-native-a-year-in-review">React Native: A year in review</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2016/03/28/dive-into-react-native-performance">Dive into React Native Performance</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2016/03/24/introducing-hot-reloading">Introducing Hot Reloading</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2015/11/23/making-react-native-apps-accessible">Making React Native apps accessible</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2015/09/14/react-native-for-android">React Native for Android: How we built the first cross-platform React Native app</a></li><li class="navListItem"><a class="navItem" href="/react-native/blog/2015/03/26/react-native-bringing-modern-web-techniques-to-mobile">React Native: Bringing modern web techniques to mobile</a></li></ul></div></div></section></div><script>
|
||
var coll = document.getElementsByClassName('collapsible');
|
||
var checkActiveCategory = true;
|
||
for (var i = 0; i < coll.length; i++) {
|
||
var links = coll[i].nextElementSibling.getElementsByTagName('*');
|
||
if (checkActiveCategory){
|
||
for (var j = 0; j < links.length; j++) {
|
||
if (links[j].classList.contains('navListItemActive')){
|
||
coll[i].nextElementSibling.classList.toggle('hide');
|
||
coll[i].childNodes[1].classList.toggle('rotate');
|
||
checkActiveCategory = false;
|
||
break;
|
||
}
|
||
}
|
||
}
|
||
|
||
coll[i].addEventListener('click', function() {
|
||
var arrow = this.childNodes[1];
|
||
arrow.classList.toggle('rotate');
|
||
var content = this.nextElementSibling;
|
||
content.classList.toggle('hide');
|
||
});
|
||
}
|
||
|
||
document.addEventListener('DOMContentLoaded', function() {
|
||
createToggler('#navToggler', '#docsNav', 'docsSliderActive');
|
||
createToggler('#tocToggler', 'body', 'tocActive');
|
||
|
||
var headings = document.querySelector('.toc-headings');
|
||
headings && headings.addEventListener('click', function(event) {
|
||
var el = event.target;
|
||
while(el !== headings){
|
||
if (el.tagName === 'A') {
|
||
document.body.classList.remove('tocActive');
|
||
break;
|
||
} else{
|
||
el = el.parentNode;
|
||
}
|
||
}
|
||
}, false);
|
||
|
||
function createToggler(togglerSelector, targetSelector, className) {
|
||
var toggler = document.querySelector(togglerSelector);
|
||
var target = document.querySelector(targetSelector);
|
||
|
||
if (!toggler) {
|
||
return;
|
||
}
|
||
|
||
toggler.onclick = function(event) {
|
||
event.preventDefault();
|
||
|
||
target.classList.toggle(className);
|
||
};
|
||
}
|
||
});
|
||
</script></nav></div><div class="container mainContainer postContainer blogContainer"><div class="wrapper"><div class="posts"><div class="post"><header class="postHeader"><h1 class="postHeaderTitle"><a href="/react-native/blog/2017/07/28/react-native-monthly-2">React Native Monthly #2</a></h1><p class="post-meta">July 28, 2017</p><div class="authorBlock"><p class="post-authorName"><a href="https://github.com/tenodi" target="_blank" rel="noreferrer noopener">Tomislav Tenodi</a>Product Manager at Shoutem</p><div class="authorPhoto authorPhotoBig"><a href="https://github.com/tenodi" target="_blank" rel="noreferrer noopener"><img src="https://pbs.twimg.com/profile_images/877237660225609729/bKFDwfAq.jpg" alt="Tomislav Tenodi"/></a></div></div></header><article class="post-content"><div><span><p>The React Native monthly meeting continues! On this session, we were joined by <a href="https://infinite.red/">Infinite Red</a>, great minds behind <a href="https://infinite.red/ChainReactConf">Chain React, the React Native Conference</a>. As most of the people here were presenting talks at Chain React, we pushed the meeting to a week later. Talks from the conference have been <a href="https://www.youtube.com/playlist?list=PLFHvL21g9bk3RxJ1Ut5nR_uTZFVOxu522">posted online</a> and I encourage you to check them out. So, let's see what our teams are up to.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="teams"></a><a href="#teams" 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>Teams</h2>
|
||
<p>On this second meeting, we had 9 teams join us:</p>
|
||
<ul>
|
||
<li><a href="https://github.com/airbnb">Airbnb</a></li>
|
||
<li><a href="https://github.com/callstack-io">Callstack</a></li>
|
||
<li><a href="https://github.com/expo">Expo</a></li>
|
||
<li><a href="https://github.com/facebook">Facebook</a></li>
|
||
<li><a href="https://github.com/GeekyAnts">GeekyAnts</a></li>
|
||
<li><a href="https://github.com/infinitered">Infinite Red</a></li>
|
||
<li><a href="https://github.com/microsoft">Microsoft</a></li>
|
||
<li><a href="https://github.com/shoutem">Shoutem</a></li>
|
||
<li><a href="https://github.com/wix">Wix</a></li>
|
||
</ul>
|
||
<h2><a class="anchor" aria-hidden="true" id="notes"></a><a href="#notes" 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>Notes</h2>
|
||
<p>Here are the notes from each team:</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="airbnb"></a><a href="#airbnb" 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>Airbnb</h3>
|
||
<ul>
|
||
<li>Check out the <a href="https://github.com/airbnb">Airbnb repository</a> for React Native related projects.</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="callstack"></a><a href="#callstack" 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>Callstack</h3>
|
||
<ul>
|
||
<li><a href="https://github.com/grabbou">Mike Grabowski</a> has been managing React Native's monthly releases as always, including a few betas that were pushed out. In particular, working on getting a v0.43.5 build published to npm since it unblocks Windows users!</li>
|
||
<li>Slow but consistent work is happening on <a href="https://github.com/callstack-io/haul">Haul</a>. There is a pull request that adds HMR, and other improvements have shipped. Recently got a few industry leaders to adopt it. Possibly planning to start a full-time paid work in that area.</li>
|
||
<li><a href="https://twitter.com/thymikee">Michał Pierzchała</a> from the <a href="https://github.com/facebook/jest">Jest</a> team has joined us at Callstack this month. He will help maintain <a href="https://github.com/callstack-io/haul">Haul</a> and possibly work on <a href="https://github.com/facebook/metro">Metro Bundler</a> and <a href="https://github.com/facebook/jest">Jest</a>.</li>
|
||
<li><a href="https://twitter.com/satya164">Satyajit Sahoo</a> is now with us, yay!</li>
|
||
<li>Got a bunch of cool stuff coming up from our OSS department. In particular, working on bringing Material Palette API to React Native. Planning to finally release our native iOS kit which is aimed to provide 1:1 look & feel of native components.</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="expo"></a><a href="#expo" 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>Expo</h3>
|
||
<ul>
|
||
<li>Recently launched <a href="https://native.directory">Native Directory</a> to help with discoverability and evaluation of libraries in React Native ecosystem. The problem: lots of libraries, hard to test, need to manually apply heuristics and not immediately obvious which ones are just the best ones that you should use. It's also hard to know if something is compatible with CRNA/Expo. So Native Directory tries to solve these problems. Check it out and <a href="https://github.com/react-community/native-directory">add your library</a> to it. The list of libraries is in <a href="https://github.com/react-community/native-directory/blob/master/react-native-libraries.json">here</a>. This is just our first pass of it, and we want this to be owned and run by the community, not just Expo folks. So please pitch in if you think this is valuable and want to make it better!</li>
|
||
<li>Added initial support for installing npm packages in <a href="https://snack.expo.io/">Snack</a> with Expo SDK 19. Let us know if you run into any issues with it, we are still working through some bugs. Along with Native Directory, this should make it easy to test libraries that have only JS dependencies, or dependencies included in <a href="https://github.com/expo/expo-sdk">Expo SDK</a>. Try it out:
|
||
<ul>
|
||
<li><a href="https://snack.expo.io/ByBCD_2r-">react-native-modal</a></li>
|
||
<li><a href="https://snack.expo.io/SJfJguhrW">react-native-animatable</a></li>
|
||
<li><a href="https://snack.expo.io/HkoXUdhr-">react-native-calendars</a></li>
|
||
</ul></li>
|
||
<li><a href="https://blog.expo.io/expo-sdk-v19-0-0-is-now-available-821a62b58d3d">Released Expo SDK19</a> with a bunch of improvements across the board, and we're now using the <a href="https://github.com/SoftwareMansion/jsc-android-buildscripts">updated Android JSC</a>.</li>
|
||
<li>Working on a guide in docs with <a href="https://github.com/frantic">Alexander Kotliarskyi</a> with a list of tips on how to improve the user experience of your app. Please join in and add to the list or help write some of it!
|
||
<ul>
|
||
<li>Issue: <a href="https://github.com/facebook/react-native/issues/14979">#14979</a></li>
|
||
<li>Initial pull request: <a href="https://github.com/facebook/react-native/pull/14993">#14993</a></li>
|
||
</ul></li>
|
||
<li>Continuing to work on: audio/video, camera, gestures (with Software Mansion, <code>react-native-gesture-handler</code>), GL camera integration and hoping to land some of these for the first time in SDK20 (August), and significant improvements to others by then as well. We're just getting started on building infrastructure into the Expo client for background work (geolocation, audio, handling notifications, etc.).</li>
|
||
<li><a href="https://twitter.com/skevy">Adam Miskiewicz</a> has made some nice progress on imitating the transitions from <a href="https://developer.apple.com/documentation/uikit/uinavigationcontroller">UINavigationController</a> in <a href="https://github.com/react-community/react-navigation">react-navigation</a>. Check out an earlier version of it in <a href="https://twitter.com/skevy/status/884932473070735361">his tweet</a> - release coming with it soon. Also check out <code>MaskedViewIOS</code> which he <a href="https://github.com/facebook/react-native/commit/8ea6cea39a3db6171dd74838a6eea4631cf42bba">upstreamed</a>. If you have the skills and desire to implement <code>MaskedView</code> for Android that would be awesome!</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="facebook"></a><a href="#facebook" 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>Facebook</h3>
|
||
<ul>
|
||
<li>Facebook is internally exploring being able to embed native <a href="http://componentkit.org/">ComponentKit</a> and <a href="https://fblitho.com/">Litho</a> components inside of React Native.</li>
|
||
<li>Contributions to React Native are very welcome! If you are wondering how you can contribute, the <a href="http://facebook.github.io/react-native/contributing.md">"How to Contribute" guide</a> describes our development process and lays out the steps to send your first pull request. There are other ways to contribute that do not require writing code, such as by triaging issues or updating the docs.
|
||
<ul>
|
||
<li>At the time of writing, React Native has <strong>635</strong> <a href="https://github.com/facebook/react-native/issues">open issues</a> and <strong>249</strong> <a href="https://github.com/facebook/react-native/pulls">open pull requests</a>. This is overwhelming for our maintainers, and when things get fixed internally, it is difficult to ensure the relevant tasks are updated.</li>
|
||
<li>We are unsure what the best approach is to handle this while keeping the community satisfied. Some (but not all!) options include closing stale issues, giving significantly more people permissions to manage issues, and automatically closing issues that do not follow the issue template. We wrote a <a href="http://facebook.github.io/react-native/maintainers.md">"What to Expect from Maintainers"</a> guide to set expectations and avoid surprises. If you have ideas on how we can make this experience better for maintainers as well as ensuring people opening issues and pull requests feel heard and valued, please let us know!</li>
|
||
</ul></li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="geekyants"></a><a href="#geekyants" 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>GeekyAnts</h3>
|
||
<ul>
|
||
<li>We demoed the Designer Tool which works with React Native files on Chain React. Many attendees signed up for the waiting list.</li>
|
||
<li>We are also looking at other cross-platform solutions like <a href="https://flutter.io/">Google Flutter</a> (a major comparison coming along), <a href="https://github.com/JetBrains/kotlin-native">Kotlin Native</a>, and <a href="https://weex.incubator.apache.org/">Apache Weex</a> to understand the architectural differences and what we can learn from them to improve the overall performance of React Native.</li>
|
||
<li>Switched to <a href="https://github.com/react-community/react-navigation">react-navigation</a> for most of our apps, which has improved the overall performance.</li>
|
||
<li>Also, announced <a href="https://market.nativebase.io/">NativeBase Market</a> - A marketplace for React Native components and apps (for and by the developers).</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="infinite-red"></a><a href="#infinite-red" 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>Infinite Red</h3>
|
||
<ul>
|
||
<li>We want to introduce the <a href="https://github.com/infinitered/reactotron">Reactotron</a>. Check out the <a href="https://www.youtube.com/watch?v=tPBRfxswDjA">introductory video</a>. We'll be adding more features very soon!</li>
|
||
<li>Organised Chain React Conference. It was awesome, thanks all for coming! <a href="https://www.youtube.com/playlist?list=PLFHvL21g9bk3RxJ1Ut5nR_uTZFVOxu522">The videos are now online!</a></li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="microsoft"></a><a href="#microsoft" 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>Microsoft</h3>
|
||
<ul>
|
||
<li><a href="https://github.com/Microsoft/code-push">CodePush</a> has now been integrated into <a href="https://mobile.azure.com/">Mobile Center</a>. Existing users will have no change in their workflow.
|
||
<ul>
|
||
<li>Some people have reported an issue with duplicate apps - they already had an app on Mobile Center. We are working on resolving them, but if you have two apps, let us know, and we can merge them for you.</li>
|
||
</ul></li>
|
||
<li>Mobile Center now supports Push Notifications for CodePush. We also showed how a combination of Notifications and CodePush could be used for A/B testing apps - something unique to the ReactNative architecture.</li>
|
||
<li><a href="https://github.com/Microsoft/vscode">VSCode</a> has a known debugging issue with ReactNative - the next release of the extension in a couple of days will be fixing the issue.</li>
|
||
<li>Since there are many other teams also working on React Native inside Microsoft, we will work on getting better representation from all the groups for the next meeting.</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="shoutem"></a><a href="#shoutem" 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>Shoutem</h3>
|
||
<ul>
|
||
<li>Finished the process of making the React Native development easier on <a href="https://shoutem.github.io/">Shoutem</a>. You can use all the standard <code>react-native</code> commands when developing apps on Shoutem.</li>
|
||
<li>We did a lot of work trying to figure out how to best approach the profiling on React Native. A big chunk of <a href="https://facebook.github.io/react-native/performance.md">documentation</a> is outdated, and we'll do our best to create a pull request on the official docs or at least write some of our conclusions in a blog post.</li>
|
||
<li>Switching our navigation solution to <a href="https://github.com/react-community/react-navigation">react-navigation</a>, so we might have some feedback soon.</li>
|
||
<li>We released <a href="https://github.com/shoutem/ui/tree/develop/html">a new HTML component</a> in our toolkit which transforms the raw HTML to the React Native components tree.</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="wix"></a><a href="#wix" 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>Wix</h3>
|
||
<ul>
|
||
<li>We started working on a pull request to <a href="https://github.com/facebook/metro">Metro Bundler</a> with <a href="https://github.com/wix/react-native-repackager">react-native-repackager</a> capabilities. We updated react-native-repackager to support RN 44 (which we use in production). We are using it for our mocking infrastructure for <a href="https://github.com/wix/detox">detox</a>.</li>
|
||
<li>We have been covering the Wix app in detox tests for the last three weeks. It's an amazing learning experience of how to reduce manual QA in an app of this scale (over 40 engineers). We have resolved several issues with detox as a result, a new version was just published. I am happy to report that we are living up to the "zero flakiness policy" and the tests are passing consistently so far.</li>
|
||
<li>Detox for Android is moving forward nicely. We are getting significant help from the community. We are expecting an initial version in about two weeks.</li>
|
||
<li><a href="https://github.com/wix/detoxinstruments">DetoxInstruments</a>, our performance testing tool, is getting a little bigger than we originally intended. We are now planning to turn it into a standalone tool that will not be tightly coupled to detox. It will allow investigating the performance of iOS apps in general. It will also be integrated with detox so we can run automated tests on performance metrics.</li>
|
||
</ul>
|
||
<h2><a class="anchor" aria-hidden="true" id="next-session"></a><a href="#next-session" 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>Next session</h2>
|
||
<p>The next session is scheduled for August 16, 2017. As this was only our second meeting, we'd like to know how do these notes benefit the React Native community. Feel free to ping me <a href="https://twitter.com/TomislavTenodi">on Twitter</a> if you have any suggestion on how we should improve the output of the meeting.</p>
|
||
</span></div></article></div><div class="post"><header class="postHeader"><h1 class="postHeaderTitle"><a href="/react-native/blog/2017/06/21/react-native-monthly-1">React Native Monthly #1</a></h1><p class="post-meta">June 21, 2017</p><div class="authorBlock"><p class="post-authorName"><a href="https://github.com/tenodi" target="_blank" rel="noreferrer noopener">Tomislav Tenodi</a>Product Manager at Shoutem</p><div class="authorPhoto authorPhotoBig"><a href="https://github.com/tenodi" target="_blank" rel="noreferrer noopener"><img src="https://pbs.twimg.com/profile_images/877237660225609729/bKFDwfAq.jpg" alt="Tomislav Tenodi"/></a></div></div></header><article class="post-content"><div><span><p>At <a href="https://shoutem.github.io/">Shoutem</a>, we've been fortunate enough to work with React Native from its very beginnings. We decided we wanted to be part of the amazing community from day one. Soon enough, we realized it's almost impossible to keep up with the pace the community was growing and improving. That's why we decided to organize a monthly meeting where all major React Native contributors can briefly present what their efforts and plans are.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="monthly-meetings"></a><a href="#monthly-meetings" 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>Monthly meetings</h2>
|
||
<p>We had our first session of the monthly meeting on June 14, 2017. The mission for React Native Monthly is simple and straightforward: <strong>improve the React Native community</strong>. Presenting teams' efforts eases collaboration between teams done offline.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="teams"></a><a href="#teams" 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>Teams</h2>
|
||
<p>On the first meeting, we had 8 teams join us:</p>
|
||
<ul>
|
||
<li><a href="https://github.com/airbnb">Airbnb</a></li>
|
||
<li><a href="https://github.com/callstack-io">Callstack</a></li>
|
||
<li><a href="https://github.com/expo">Expo</a></li>
|
||
<li><a href="https://github.com/facebook">Facebook</a></li>
|
||
<li><a href="https://github.com/GeekyAnts">GeekyAnts</a></li>
|
||
<li><a href="https://github.com/microsoft">Microsoft</a></li>
|
||
<li><a href="https://github.com/shoutem">Shoutem</a></li>
|
||
<li><a href="https://github.com/wix">Wix</a></li>
|
||
</ul>
|
||
<p>We hope to have more core contributors join the upcoming sessions!</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="notes"></a><a href="#notes" 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>Notes</h2>
|
||
<p>As teams' plans might be of interest to a broader audience, we'll be sharing them here, on the React Native blog. So, here they are:</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="airbnb"></a><a href="#airbnb" 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>Airbnb</h3>
|
||
<ul>
|
||
<li>Plans to add some A11y (accessibility) APIs to <code>View</code> and the <code>AccessibilityInfo</code> native module.</li>
|
||
<li>Will be investigating adding some APIs to native modules on Android to allow for specifying threads for them to run on.</li>
|
||
<li>Have been investigating potential initialization performance improvements.</li>
|
||
<li>Have been investigating some more sophisticated bundling strategies to use on top of "unbundle".</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="callstack"></a><a href="#callstack" 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>Callstack</h3>
|
||
<ul>
|
||
<li>Looking into improving the release process by using <a href="https://github.com/wix/detox">Detox</a> for E2E testing. Pull request should land soon.</li>
|
||
<li>Blob pull request they have been working on has been merged, subsequent pull requests coming up.</li>
|
||
<li>Increasing <a href="https://github.com/callstack-io/haul">Haul</a> adoption across internal projects to see how it performs compared to <a href="http://github.com/facebook/metro-bundler">Metro Bundler</a>. Working on better multi-threaded performance with the Webpack team.</li>
|
||
<li>Internally, they have implemented a better infrastructure to manage open source projects. Plans to be getting more stuff out in upcoming weeks.</li>
|
||
<li>The React Native Europe conference is coming along, nothing interesting yet, but y'all invited!</li>
|
||
<li>Stepped back from <a href="https://github.com/react-community/react-navigation">react-navigation</a> for a while to investigate alternatives (especially native navigations).</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="expo"></a><a href="#expo" 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>Expo</h3>
|
||
<ul>
|
||
<li>Working on making it possible to install npm modules in <a href="https://snack.expo.io/">Snack</a>, will be useful for libraries to add examples to documentation.</li>
|
||
<li>Working with <a href="https://github.com/kmagiera">Krzysztof</a> and other people at <a href="https://github.com/softwaremansion">Software Mansion</a> on a JSC update on Android and a gesture handling library.</li>
|
||
<li><a href="https://github.com/skevy">Adam Miskiewicz</a> is transitioning his focus towards <a href="https://github.com/react-community/react-navigation">react-navigation</a>.</li>
|
||
<li><a href="https://github.com/react-community/create-react-native-app">Create React Native App</a> is in the <a href="https://facebook.github.io/react-native/getting-started.md">Getting Started guide</a> in the docs. Expo wants to encourage library authors to explain clearly whether their lib works with CRNA or not, and if so, explain how to set it up.</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="facebook"></a><a href="#facebook" 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>Facebook</h3>
|
||
<ul>
|
||
<li>React Native's packager is now <a href="https://github.com/facebook/metro">Metro Bundler</a>, in an independent repo. The Metro Bundler team in London is excited to address the needs of the community, improve modularity for additional use-cases beyond React Native, and increase responsiveness on issues and PRs.</li>
|
||
<li>In the coming months, the React Native team will work on refining the APIs of primitive components. Expect improvements in layout quirks, accessibility, and flow typing.</li>
|
||
<li>The React Native team also plans on improving core modularity this year, by refactoring to fully support 3rd party platforms such as Windows and macOS.</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="geekyants"></a><a href="#geekyants" 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>GeekyAnts</h3>
|
||
<ul>
|
||
<li>The team is working on a UI/UX design app (codename: Builder) which directly works with <code>.js</code> files. Right now, it supports only React Native. It’s similar to Adobe XD and Sketch.</li>
|
||
<li>The team is working hard so that you can load up an existing React Native app in the editor, make changes (visually, as a designer) and save the changes directly to the JS file.</li>
|
||
<li>Folks are trying to bridge the gap between Designers and Developers and bring them on the same repo.</li>
|
||
<li>Also, <a href="https://github.com/GeekyAnts/NativeBase">NativeBase</a> recently reached 5,000 GitHub stars.</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="microsoft"></a><a href="#microsoft" 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>Microsoft</h3>
|
||
<ul>
|
||
<li><a href="https://github.com/Microsoft/code-push">CodePush</a> has now been integrated into <a href="https://mobile.azure.com/">Mobile Center</a>. This is the first step in providing a much more integrated experience with distribution, analytics and other services. See their announcement <a href="https://microsoft.github.io/code-push/articles/CodePushOnMobileCenter.html">here</a>.</li>
|
||
<li><a href="https://github.com/Microsoft/vscode">VSCode</a> has a bug with debugging, they are working on fixing that right now and will have a new build.</li>
|
||
<li>Investigating <a href="https://github.com/wix/detox">Detox</a> for Integration testing, looking at JSC Context to get variables alongside crash reports.</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="shoutem"></a><a href="#shoutem" 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>Shoutem</h3>
|
||
<ul>
|
||
<li>Making it easier to work on Shoutem apps with tools from the React Native community. You will be able to use all the React Native commands to run the apps created on <a href="https://shoutem.github.io/">Shoutem</a>.</li>
|
||
<li>Investigating profiling tools for React Native. They had a lot of problems setting it up and they will write some of the insights they discovered along the way.</li>
|
||
<li>Shoutem is working on making it easier to integrate React Native with existing native apps. They will document the concept that they developed internally in the company, in order to get the feedback from the community.</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="wix"></a><a href="#wix" 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>Wix</h3>
|
||
<ul>
|
||
<li>Working internally to adopt <a href="https://github.com/wix/detox">Detox</a> to move significant parts of the Wix app to "zero manual QA". As a result, Detox is being used heavily in a production setting by dozens of developers and maturing rapidly.</li>
|
||
<li>Working to add support to the <a href="https://github.com/facebook/metro">Metro Bundler</a> for overriding any file extension during the build. Instead of just "ios" and "android", it would support any custom extension like "e2e" or "detox". Plans to use this for E2E mocking. There's already a library out called <a href="https://github.com/wix/react-native-repackager">react-native-repackager</a>, now working on a PR.</li>
|
||
<li>Investigating automation of performance tests. This is a new repo called <a href="https://github.com/wix/DetoxInstruments">DetoxInstruments</a>. You can take a look, it's being developed open source.</li>
|
||
<li>Working with a contributor from KPN on Detox for Android and supporting real devices.</li>
|
||
<li>Thinking about "Detox as a platform" to allow building other tools that need to automate the simulator/device. An example is <a href="https://github.com/storybooks/react-native-storybook">Storybook</a> for React Native or Ram's idea for integration testing.</li>
|
||
</ul>
|
||
<h2><a class="anchor" aria-hidden="true" id="next-session"></a><a href="#next-session" 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>Next session</h2>
|
||
<p>Meetings will be held every four weeks. The next session is scheduled for July 12, 2017. As we just started with this meeting, we'd like to know how do these notes benefit the React Native community. Feel free to ping me <a href="https://twitter.com/TomislavTenodi">on Twitter</a> if you have any suggestion on what we should cover in the following sessions, or how we should improve the output of the meeting.</p>
|
||
</span></div></article></div><div class="post"><header class="postHeader"><h1 class="postHeaderTitle"><a href="/react-native/blog/2017/03/13/idx-the-existential-function">idx: The Existential Function</a></h1><p class="post-meta">March 13, 2017</p><div class="authorBlock"><p class="post-authorName"><a href="https://github.com/yungsters" target="_blank" rel="noreferrer noopener">Timothy Yung</a>Engineering Manager at Facebook</p><div class="authorPhoto authorPhotoBig"><a href="https://github.com/yungsters" target="_blank" rel="noreferrer noopener"><img src="https://pbs.twimg.com/profile_images/1592444107/image.jpg" alt="Timothy Yung"/></a></div></div></header><article class="post-content"><div><span><p>At Facebook, we often need to access deeply nested values in data structures fetched with GraphQL. On the way to accessing these deeply nested values, it is common for one or more intermediate fields to be nullable. These intermediate fields may be null for a variety of reasons, from failed privacy checks to the mere fact that null happens to be the most flexible way to represent non-fatal errors.</p>
|
||
<p>Unfortunately, accessing these deeply nested values is currently tedious and verbose.</p>
|
||
<pre><code class="hljs css language-javascript">props<span class="token punctuation">.</span>user <span class="token operator">&&</span>
|
||
props<span class="token punctuation">.</span>user<span class="token punctuation">.</span>friends <span class="token operator">&&</span>
|
||
props<span class="token punctuation">.</span>user<span class="token punctuation">.</span>friends<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">&&</span>
|
||
props<span class="token punctuation">.</span>user<span class="token punctuation">.</span>friends<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>friends<span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>There is <a href="https://github.com/claudepache/es-optional-chaining">an ECMAScript proposal to introduce the existential operator</a> which will make this much more convenient. But until a time when that proposal is finalized, we want a solution that improves our quality of life, maintains existing language semantics, and encourages type safety with Flow.</p>
|
||
<p>We came up with an existential <em>function</em> we call <code>idx</code>.</p>
|
||
<pre><code class="hljs css language-javascript"><span class="token function">idx</span><span class="token punctuation">(</span>props<span class="token punctuation">,</span> <span class="token punctuation">(</span>_<span class="token punctuation">)</span> <span class="token operator">=></span> _<span class="token punctuation">.</span>user<span class="token punctuation">.</span>friends<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>friends<span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>The invocation in this code snippet behaves similarly to the boolean expression in the code snippet above, except with significantly less repetition. The <code>idx</code> function takes exactly two arguments:</p>
|
||
<ul>
|
||
<li>Any value, typically an object or array into which you want to access a nested value.</li>
|
||
<li>A function that receives the first argument and accesses a nested value on it.</li>
|
||
</ul>
|
||
<p>In theory, the <code>idx</code> function will try-catch errors that are the result of accessing properties on null or undefined. If such an error is caught, it will return either null or undefined. (And you can see how this might be implemented in <a href="https://github.com/facebookincubator/idx/blob/master/packages/idx/src/idx.js">idx.js</a>.)</p>
|
||
<p>In practice, try-catching every nested property access is slow, and differentiating between specific kinds of TypeErrors is fragile. To deal with these shortcomings, we created a Babel plugin that transforms the above <code>idx</code> invocation into the following expression:</p>
|
||
<pre><code class="hljs css language-javascript">props<span class="token punctuation">.</span>user <span class="token operator">==</span> <span class="token keyword">null</span>
|
||
<span class="token operator">?</span> props<span class="token punctuation">.</span>user
|
||
<span class="token punctuation">:</span> props<span class="token punctuation">.</span>user<span class="token punctuation">.</span>friends <span class="token operator">==</span> <span class="token keyword">null</span>
|
||
<span class="token operator">?</span> props<span class="token punctuation">.</span>user<span class="token punctuation">.</span>friends
|
||
<span class="token punctuation">:</span> props<span class="token punctuation">.</span>user<span class="token punctuation">.</span>friends<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span> <span class="token operator">==</span> <span class="token keyword">null</span>
|
||
<span class="token operator">?</span> props<span class="token punctuation">.</span>user<span class="token punctuation">.</span>friends<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span>
|
||
<span class="token punctuation">:</span> props<span class="token punctuation">.</span>user<span class="token punctuation">.</span>friends<span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">.</span>friends<span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Finally, we added a custom Flow type declaration for <code>idx</code> that allows the traversal in the second argument to be properly type-checked while permitting nested access on nullable properties.</p>
|
||
<p>The function, Babel plugin, and Flow declaration are now <a href="https://github.com/facebookincubator/idx">available on GitHub</a>. They are used by installing the <strong>idx</strong> and <strong>babel-plugin-idx</strong> npm packages, and adding “idx” to the list of plugins in your <code>.babelrc</code> file.</p>
|
||
</span></div></article></div><div class="post"><header class="postHeader"><h1 class="postHeaderTitle"><a href="/react-native/blog/2017/03/13/better-list-views">Better List Views in React Native</a></h1><p class="post-meta">March 13, 2017</p><div class="authorBlock"><p class="post-authorName"><a href="https://github.com/sahrens" target="_blank" rel="noreferrer noopener">Spencer Ahrens</a>Software Engineer at Facebook</p><div class="authorPhoto authorPhotoBig"><a href="https://github.com/sahrens" target="_blank" rel="noreferrer noopener"><img src="https://avatars1.githubusercontent.com/u/1509831" alt="Spencer Ahrens"/></a></div></div></header><article class="post-content"><div><span><p>Many of you have started playing with some of our new List components already after our <a href="https://www.facebook.com/groups/react.native.community/permalink/921378591331053">teaser announcement in the community group</a>, but we are officially announcing them today! No more <code>ListView</code>s or <code>DataSource</code>s, stale rows, ignored bugs, or excessive memory consumption - with the latest React Native March 2017 release candidate (<code>0.43-rc.1</code>) you can pick from the new suite of components what best fits your use-case, with great perf and feature sets out of the box:</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="flatlist-https-facebookgithubio-react-native-releases-next-flatlistmd"></a><a href="#flatlist-https-facebookgithubio-react-native-releases-next-flatlistmd" 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://facebook.github.io/react-native/releases/next/flatlist.md"><code><FlatList></code></a></h3>
|
||
<p>This is the workhorse component for simple, performant lists. Provide an array of data and a <code>renderItem</code> function and you're good to go:</p>
|
||
<pre><code class="hljs"><FlatList
|
||
data={[{title: <span class="hljs-string">'Title Text'</span>, key: <span class="hljs-string">'item1'</span>}, ...]}
|
||
renderItem={({item}) => <ListItem title={item.title} />}
|
||
/>
|
||
</code></pre>
|
||
<h3><a class="anchor" aria-hidden="true" id="sectionlist-https-facebookgithubio-react-native-releases-next-sectionlistmd"></a><a href="#sectionlist-https-facebookgithubio-react-native-releases-next-sectionlistmd" 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://facebook.github.io/react-native/releases/next/sectionlist.md"><code><SectionList></code></a></h3>
|
||
<p>If you want to render a set of data broken into logical sections, maybe with section headers (e.g. in an alphabetical address book), and potentially with heterogeneous data and rendering (such as a profile view with some buttons followed by a composer, then a photo grid, then a friend grid, and finally a list of stories), this is the way to go.</p>
|
||
<pre><code class="hljs"><SectionList
|
||
renderItem={({item}) => <ListItem title={item.title} />}
|
||
renderSectionHeader={({section}) => <H1 title={section.key} />}
|
||
sections={[ <span class="hljs-comment">// homogeneous rendering between sections</span>
|
||
{data: [...], key: ...},
|
||
{data: [...], key: ...},
|
||
{data: [...], key: ...},
|
||
]}
|
||
/>
|
||
|
||
<SectionList
|
||
sections={[ <span class="hljs-comment">// heterogeneous rendering between sections</span>
|
||
{data: [...], key: ..., renderItem: ...},
|
||
{data: [...], key: ..., renderItem: ...},
|
||
{data: [...], key: ..., renderItem: ...},
|
||
]}
|
||
/>
|
||
</code></pre>
|
||
<h3><a class="anchor" aria-hidden="true" id="virtualizedlist-https-facebookgithubio-react-native-releases-next-virtualizedlistmd"></a><a href="#virtualizedlist-https-facebookgithubio-react-native-releases-next-virtualizedlistmd" 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://facebook.github.io/react-native/releases/next/virtualizedlist.md"><code><VirtualizedList></code></a></h3>
|
||
<p>The implementation behind the scenes with a more flexible API. Especially handy if your data is not in a plain array (e.g. an immutable list).</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="features"></a><a href="#features" 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>Features</h2>
|
||
<p>Lists are used in many contexts, so we packed the new components full of features to handle the majority of use cases out of the box:</p>
|
||
<ul>
|
||
<li>Scroll loading (<code>onEndReached</code>).</li>
|
||
<li>Pull to refresh (<code>onRefresh</code> / <code>refreshing</code>).</li>
|
||
<li><a href="https://github.com/facebook/react-native/blob/master/Libraries/CustomComponents/Lists/ViewabilityHelper.js">Configurable</a> viewability (VPV) callbacks (<code>onViewableItemsChanged</code> / <code>viewabilityConfig</code>).</li>
|
||
<li>Horizontal mode (<code>horizontal</code>).</li>
|
||
<li>Intelligent item and section separators.</li>
|
||
<li>Multi-column support (<code>numColumns</code>)</li>
|
||
<li><code>scrollToEnd</code>, <code>scrollToIndex</code>, and <code>scrollToItem</code></li>
|
||
<li>Better Flow typing.</li>
|
||
</ul>
|
||
<h3><a class="anchor" aria-hidden="true" id="some-caveats"></a><a href="#some-caveats" 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>Some Caveats</h3>
|
||
<ul>
|
||
<li><p>The internal state of item subtrees is not preserved when content scrolls out of the render window. Make sure all your data is captured in the item data or external stores like Flux, Redux, or Relay.</p></li>
|
||
<li><p>These components are based on <code>PureComponent</code> which means that they will not re-render if <code>props</code> remains shallow-equal. Make sure that everything your <code>renderItem</code> function depends on directly is passed as a prop that is not <code>===</code> after updates, otherwise your UI may not update on changes. This includes the <code>data</code> prop and parent component state. For example:</p>
|
||
<pre><code class="hljs css language-javascript"><span class="token operator"><</span>FlatList
|
||
data<span class="token operator">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>data<span class="token punctuation">}</span>
|
||
renderItem<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">(</span><span class="token punctuation">{</span>item<span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span>
|
||
<span class="token operator"><</span>MyItem
|
||
item<span class="token operator">=</span><span class="token punctuation">{</span>item<span class="token punctuation">}</span>
|
||
onPress<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span>
|
||
<span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">(</span>oldState<span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">(</span><span class="token punctuation">{</span>
|
||
selected<span class="token punctuation">:</span> <span class="token punctuation">{</span>
|
||
<span class="token comment">// New instance breaks `===`</span>
|
||
<span class="token operator">...</span>oldState<span class="token punctuation">.</span>selected<span class="token punctuation">,</span> <span class="token comment">// copy old data</span>
|
||
<span class="token punctuation">[</span>item<span class="token punctuation">.</span>key<span class="token punctuation">]</span><span class="token punctuation">:</span> <span class="token operator">!</span>oldState<span class="token punctuation">.</span>selected<span class="token punctuation">[</span>item<span class="token punctuation">.</span>key<span class="token punctuation">]</span><span class="token punctuation">,</span> <span class="token comment">// toggle</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">,</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
|
||
<span class="token punctuation">}</span>
|
||
selected<span class="token operator">=</span><span class="token punctuation">{</span>
|
||
<span class="token operator">!</span><span class="token operator">!</span><span class="token keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>selected<span class="token punctuation">[</span>item<span class="token punctuation">.</span>key<span class="token punctuation">]</span> <span class="token comment">// renderItem depends on state</span>
|
||
<span class="token punctuation">}</span>
|
||
<span class="token operator">/</span><span class="token operator">></span>
|
||
<span class="token punctuation">)</span><span class="token punctuation">}</span>
|
||
selected<span class="token operator">=</span><span class="token punctuation">{</span>
|
||
<span class="token comment">// Can be any prop that doesn't collide with existing props</span>
|
||
<span class="token keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>selected <span class="token comment">// A change to selected should re-render FlatList</span>
|
||
<span class="token punctuation">}</span>
|
||
<span class="token operator">/</span><span class="token operator">></span>
|
||
</code></pre></li>
|
||
<li><p>In order to constrain memory and enable smooth scrolling, content is rendered asynchronously offscreen. This means it's possible to scroll faster than the fill rate and momentarily see blank content. This is a tradeoff that can be adjusted to suit the needs of each application, and we are working on improving it behind the scenes.</p></li>
|
||
<li><p>By default, these new lists look for a <code>key</code> prop on each item and use that for the React key. Alternatively, you can provide a custom <code>keyExtractor</code> prop.</p></li>
|
||
</ul>
|
||
<h2><a class="anchor" aria-hidden="true" id="performance"></a><a href="#performance" 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>Performance</h2>
|
||
<p>Besides simplifying the API, the new list components also have significant performance enhancements, the main one being nearly constant memory usage for any number of rows. This is done by 'virtualizing' elements that are outside of the render window by completely unmounting them from the component hierarchy and reclaiming the JS memory from the react components, along with the native memory from the shadow tree and the UI views. This has a catch which is that internal component state will not be preserved, so <strong>make sure you track any important state outside of the components themselves, e.g. in Relay or Redux or Flux store.</strong></p>
|
||
<p>Limiting the render window also reduces the amount of work that needs to be done by React and the native platform, e.g from view traversals. Even if you are rendering the last of a million elements, with these new lists there is no need to iterate through all those elements in order to render. You can even jump to the middle with <code>scrollToIndex</code> without excessive rendering.</p>
|
||
<p>We've also made some improvements with scheduling which should help with application responsiveness. Items at the edge of the render window are rendered infrequently and at a lower priority after any active gestures or animations or other interactions have completed.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="advanced-usage"></a><a href="#advanced-usage" 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>Advanced Usage</h2>
|
||
<p>Unlike <code>ListView</code>, all items in the render window are re-rendered any time any props change. Often this is fine because the windowing reduces the number of items to a constant number, but if your items are on the complex side, you should make sure to follow React best practices for performance and use <code>React.PureComponent</code> and/or <code>shouldComponentUpdate</code> as appropriate within your components to limit re-renders of the recursive subtree.</p>
|
||
<p>If you can calculate the height of your rows without rendering them, you can improve the user experience by providing the <code>getItemLayout</code> prop. This makes it much smoother to scroll to specific items with e.g. <code>scrollToIndex</code>, and will improve the scroll indicator UI because the height of the content can be determined without rendering it.</p>
|
||
<p>If you have an alternative data type, like an immutable list, <code><VirtualizedList></code> is the way to go. It takes a <code>getItem</code> prop that lets you return the item data for any given index and has looser flow typing.</p>
|
||
<p>There are also a bunch of parameters you can tweak if you have an unusual use case. For example, you can use <code>windowSize</code> to trade off memory usage vs. user experience, <code>maxToRenderPerBatch</code> to adjust fill rate vs. responsiveness, <code>onEndReachedThreshold</code> to control when scroll loading happens, and more.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="future-work"></a><a href="#future-work" 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>Future Work</h2>
|
||
<ul>
|
||
<li>Migration of existing surfaces (ultimately deprecation of <code>ListView</code>).</li>
|
||
<li>More features as we see/hear the need (let us know!).</li>
|
||
<li>Sticky section header support.</li>
|
||
<li>More performance optimizations.</li>
|
||
<li>Support functional item components with state.</li>
|
||
</ul>
|
||
</span></div></article></div><div class="post"><header class="postHeader"><h1 class="postHeaderTitle"><a href="/react-native/blog/2017/03/13/introducing-create-react-native-app">Introducing Create React Native App</a></h1><p class="post-meta">March 13, 2017</p><div class="authorBlock"><p class="post-authorName"><a href="https://github.com/dikaiosune" target="_blank" rel="noreferrer noopener">Adam Perry</a>Software Engineer at Expo</p><div class="authorPhoto authorPhotoBig"><a href="https://github.com/dikaiosune" target="_blank" rel="noreferrer noopener"><img src="https://avatars2.githubusercontent.com/u/6812281" alt="Adam Perry"/></a></div></div></header><article class="post-content"><div><span><p>Today we’re announcing <a href="https://github.com/react-community/create-react-native-app">Create React Native App</a>: a new tool that makes it significantly easier to get started with a React Native project! It’s heavily inspired by the design of <a href="https://github.com/facebookincubator/create-react-app">Create React App</a> and is the product of a collaboration between <a href="https://code.facebook.com">Facebook</a> and <a href="https://expo.io">Expo</a> (formerly Exponent).</p>
|
||
<p>Many developers struggle with installing and configuring React Native’s current native build dependencies, especially for Android. With Create React Native App, there’s no need to use Xcode or Android Studio, and you can develop for your iOS device using Linux or Windows. This is accomplished using the Expo app, which loads and runs CRNA projects written in pure JavaScript without compiling any native code.</p>
|
||
<p>Try creating a new project (replace with suitable yarn commands if you have it installed):</p>
|
||
<pre><code class="hljs">$ <span class="hljs-string">npm </span>i -g <span class="hljs-built_in">create-react-native-app</span>
|
||
$ <span class="hljs-built_in">create-react-native-app</span> <span class="hljs-string">my-project
|
||
</span>$ <span class="hljs-string">cd </span><span class="hljs-string">my-project
|
||
</span>$ <span class="hljs-string">npm </span><span class="hljs-string">start
|
||
</span></code></pre>
|
||
<p>This will start the React Native packager and print a QR code. Open it in the <a href="https://expo.io">Expo app</a> to load your JavaScript. Calls to <code>console.log</code> are forwarded to your terminal. You can make use of any standard React Native APIs as well as the <a href="https://docs.expo.io/versions/latest/sdk/index.html">Expo SDK</a>.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="what-about-native-code"></a><a href="#what-about-native-code" 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 about native code?</h2>
|
||
<p>Many React Native projects have Java or Objective-C/Swift dependencies that need to be compiled. The Expo app does include APIs for camera, video, contacts, and more, and bundles popular libraries like <a href="https://docs.expo.io/versions/v14.0.0/sdk/map-view.html">Airbnb’s react-native-maps</a>, or <a href="https://docs.expo.io/versions/latest/sdk/facebook.html">Facebook authentication</a>. However if you need a native code dependency that Expo doesn’t bundle then you’ll probably need to have your own build configuration for it. Just like Create React App, “ejecting” is supported by CRNA.</p>
|
||
<p>You can run <code>npm run eject</code> to get a project very similar to what <code>react-native init</code> would generate. At that point you’ll need Xcode and/or Android Studio just as you would if you started with <code>react-native init</code> , adding libraries with <code>react-native link</code> will work, and you’ll have full control over the native code compilation process.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="questions-feedback"></a><a href="#questions-feedback" 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>Questions? Feedback?</h2>
|
||
<p>Create React Native App is now stable enough for general use, which means we’re very eager to hear about your experience using it! You can find me <a href="https://twitter.com/dika10sune">on Twitter</a> or open an issue on <a href="https://github.com/react-community/create-react-native-app">the GitHub repository</a>. Pull requests are very welcome!</p>
|
||
</span></div></article></div><div class="post"><header class="postHeader"><h1 class="postHeaderTitle"><a href="/react-native/blog/2017/02/14/using-native-driver-for-animated">Using Native Driver for Animated</a></h1><p class="post-meta">February 14, 2017</p><div class="authorBlock"><p class="post-authorName"><a href="https://twitter.com/janicduplessis" target="_blank" rel="noreferrer noopener">Janic Duplessis</a>Software Engineer at App & Flow</p><div class="authorPhoto authorPhotoBig"><a href="https://twitter.com/janicduplessis" target="_blank" rel="noreferrer noopener"><img src="https://secure.gravatar.com/avatar/8d6b6c0f5b228b0a8566a69de448b9dd?s=128" alt="Janic Duplessis"/></a></div></div></header><article class="post-content"><div><span><p>For the past year, we've been working on improving performance of animations that use the Animated library. Animations are very important to create a beautiful user experience but can also be hard to do right. We want to make it easy for developers to create performant animations without having to worry about some of their code causing it to lag.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="what-is-this"></a><a href="#what-is-this" 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 is this?</h2>
|
||
<p>The Animated API was designed with a very important constraint in mind, it is serializable. This means we can send everything about the animation to native before it has even started and allows native code to perform the animation on the UI thread without having to go through the bridge on every frame. It is very useful because once the animation has started, the JS thread can be blocked and the animation will still run smoothly. In practice this can happen a lot because user code runs on the JS thread and React renders can also lock JS for a long time.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="a-bit-of-history"></a><a href="#a-bit-of-history" 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 bit of history...</h2>
|
||
<p>This project started about a year ago, when Expo built the li.st app on Android. <a href="https://twitter.com/kzzzf">Krzysztof Magiera</a> was contracted to build the initial implementation on Android. It ended up working well and li.st was the first app to ship with native driven animations using Animated. A few months later, <a href="https://github.com/buba447">Brandon Withrow</a> built the initial implementation on iOS. After that, <a href="https://twitter.com/ryangomba">Ryan Gomba</a> and myself worked on adding missing features like support for <code>Animated.event</code> as well as squash bugs we found when using it in production apps. This was truly a community effort and I would like to thanks everyone that was involved as well as Expo for sponsoring a large part of the development. It is now used by <code>Touchable</code> components in React Native as well as for navigation animations in the newly released <a href="https://github.com/react-community/react-navigation">React Navigation</a> library.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="how-does-it-work"></a><a href="#how-does-it-work" 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>How does it work?</h2>
|
||
<p>First, let's check out how animations currently work using Animated with the JS driver. When using Animated, you declare a graph of nodes that represent the animations that you want to perform, and then use a driver to update an Animated value using a predefined curve. You may also update an Animated value by connecting it to an event of a <code>View</code> using <code>Animated.event</code>.</p>
|
||
<p><img src="/react-native/blog/assets/animated-diagram.png" alt=""></p>
|
||
<p>Here's a breakdown of the steps for an animation and where it happens:</p>
|
||
<ul>
|
||
<li>JS: The animation driver uses <code>requestAnimationFrame</code> to execute on every frame and update the value it drives using the new value it calculates based on the animation curve.</li>
|
||
<li>JS: Intermediate values are calculated and passed to a props node that is attached to a <code>View</code>.</li>
|
||
<li>JS: The <code>View</code> is updated using <code>setNativeProps</code>.</li>
|
||
<li>JS to Native bridge.</li>
|
||
<li>Native: The <code>UIView</code> or <code>android.View</code> is updated.</li>
|
||
</ul>
|
||
<p>As you can see, most of the work happens on the JS thread. If it is blocked the animation will skip frames. It also needs to go through the JS to Native bridge on every frame to update native views.</p>
|
||
<p>What the native driver does is move all of these steps to native. Since Animated produces a graph of animated nodes, it can be serialized and sent to native only once when the animation starts, eliminating the need to callback into the JS thread; the native code can take care of updating the views directly on the UI thread on every frame.</p>
|
||
<p>Here's an example of how we can serialize an animated value and an interpolation node (not the exact implementation, just an example).</p>
|
||
<p>Create the native value node, this is the value that will be animated:</p>
|
||
<pre><code class="hljs"><span class="hljs-selector-tag">NativeAnimatedModule</span><span class="hljs-selector-class">.createNode</span>({
|
||
<span class="hljs-attribute">id</span>: <span class="hljs-number">1</span>,
|
||
type: <span class="hljs-string">'value'</span>,
|
||
initialValue: <span class="hljs-number">0</span>,
|
||
});
|
||
</code></pre>
|
||
<p>Create the native interpolation node, this tells the native driver how to interpolate a value:</p>
|
||
<pre><code class="hljs"><span class="hljs-selector-tag">NativeAnimatedModule</span><span class="hljs-selector-class">.createNode</span>({
|
||
<span class="hljs-attribute">id</span>: <span class="hljs-number">2</span>,
|
||
type: <span class="hljs-string">'interpolation'</span>,
|
||
inputRange: [<span class="hljs-number">0</span>, <span class="hljs-number">10</span>],
|
||
outputRange: [<span class="hljs-number">10</span>, <span class="hljs-number">0</span>],
|
||
extrapolate: <span class="hljs-string">'clamp'</span>,
|
||
});
|
||
</code></pre>
|
||
<p>Create the native props node, this tells the native driver which prop on the view it is attached to:</p>
|
||
<pre><code class="hljs"><span class="hljs-selector-tag">NativeAnimatedModule</span><span class="hljs-selector-class">.createNode</span>({
|
||
<span class="hljs-attribute">id</span>: <span class="hljs-number">3</span>,
|
||
type: <span class="hljs-string">'props'</span>,
|
||
properties: [<span class="hljs-string">'style.opacity'</span>],
|
||
});
|
||
</code></pre>
|
||
<p>Connect nodes together:</p>
|
||
<pre><code class="hljs">NativeAnimatedModule.connectNodes(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>);
|
||
NativeAnimatedModule.connectNodes(<span class="hljs-number">2</span>, <span class="hljs-number">3</span>);
|
||
</code></pre>
|
||
<p>Connect the props node to a view:</p>
|
||
<pre><code class="hljs"><span class="hljs-selector-tag">NativeAnimatedModule</span><span class="hljs-selector-class">.connectToView</span>(3, <span class="hljs-selector-tag">ReactNative</span><span class="hljs-selector-class">.findNodeHandle</span>(<span class="hljs-selector-tag">viewRef</span>));
|
||
</code></pre>
|
||
<p>With that, the native animated module has all the info it needs to update the native views directly without having to go to JS to calculate any value.</p>
|
||
<p>All there is left to do is actually start the animation by specifying what type of animation curve we want and what animated value to update. Timing animations can also be simplified by calculating every frame of the animation in advance in JS to make the native implementation smaller.</p>
|
||
<pre><code class="hljs"><span class="hljs-selector-tag">NativeAnimatedModule</span><span class="hljs-selector-class">.startAnimation</span>({
|
||
<span class="hljs-attribute">type</span>: <span class="hljs-string">'timing'</span>,
|
||
frames: [<span class="hljs-number">0</span>, <span class="hljs-number">0.1</span>, <span class="hljs-number">0.2</span>, <span class="hljs-number">0.4</span>, <span class="hljs-number">0.65</span>, ...],
|
||
animatedValueId: <span class="hljs-number">1</span>,
|
||
});
|
||
</code></pre>
|
||
<p>And now here's the breakdown of what happens when the animation runs:</p>
|
||
<ul>
|
||
<li>Native: The native animation driver uses <code>CADisplayLink</code> or <code>android.view.Choreographer</code> to execute on every frame and update the value it drives using the new value it calculates based on the animation curve.</li>
|
||
<li>Native: Intermediate values are calculated and passed to a props node that is attached to a native view.</li>
|
||
<li>Native: The <code>UIView</code> or <code>android.View</code> is updated.</li>
|
||
</ul>
|
||
<p>As you can see, no more JS thread and no more bridge which means faster animations! 🎉🎉</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="how-do-i-use-this-in-my-app"></a><a href="#how-do-i-use-this-in-my-app" 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>How do I use this in my app?</h2>
|
||
<p>For normal animations the answer is simple, just add <code>useNativeDriver: true</code> to the animation config when starting it.</p>
|
||
<p>Before:</p>
|
||
<pre><code class="hljs"><span class="hljs-selector-tag">Animated</span><span class="hljs-selector-class">.timing</span>(<span class="hljs-selector-tag">this</span><span class="hljs-selector-class">.state</span><span class="hljs-selector-class">.animatedValue</span>, {
|
||
<span class="hljs-attribute">toValue</span>: <span class="hljs-number">1</span>,
|
||
duration: <span class="hljs-number">500</span>,
|
||
})<span class="hljs-selector-class">.start</span>();
|
||
</code></pre>
|
||
<p>After:</p>
|
||
<pre><code class="hljs"><span class="hljs-selector-tag">Animated</span><span class="hljs-selector-class">.timing</span>(<span class="hljs-selector-tag">this</span><span class="hljs-selector-class">.state</span><span class="hljs-selector-class">.animatedValue</span>, {
|
||
<span class="hljs-attribute">toValue</span>: <span class="hljs-number">1</span>,
|
||
duration: <span class="hljs-number">500</span>,
|
||
useNativeDriver: true, // <-- Add this
|
||
})<span class="hljs-selector-class">.start</span>();
|
||
</code></pre>
|
||
<p>Animated values are only compatible with one driver so if you use native driver when starting an animation on a value, make sure every animation on that value also uses the native driver.</p>
|
||
<p>It also works with <code>Animated.event</code>, this is very useful if you have an animation that must follow the scroll position because without the native driver it will always run a frame behind of the gesture because of the async nature of React Native.</p>
|
||
<p>Before:</p>
|
||
<pre><code class="hljs"><ScrollView
|
||
scrollEventThrottle={<span class="hljs-number">16</span>}
|
||
onScroll={Animated.event(
|
||
[{ nativeEvent: { contentOffset: { y: this.state.animatedValue } } }]
|
||
)}
|
||
>
|
||
{content}
|
||
</ScrollView>
|
||
</code></pre>
|
||
<p>After:</p>
|
||
<pre><code class="hljs"><Animated<span class="hljs-selector-class">.ScrollView</span> <span class="hljs-comment">// <-- Use the Animated ScrollView wrapper</span>
|
||
scrollEventThrottle={<span class="hljs-number">1</span>} <span class="hljs-comment">// <-- Use 1 here to make sure no events are ever missed</span>
|
||
onScroll={Animated.event(
|
||
[{ nativeEvent: { contentOffset: { y: this<span class="hljs-selector-class">.state</span><span class="hljs-selector-class">.animatedValue</span> } } }],
|
||
{ useNativeDriver: true } <span class="hljs-comment">// <-- Add this</span>
|
||
)}
|
||
>
|
||
{<span class="hljs-attribute">content</span>}
|
||
</Animated.ScrollView>
|
||
</code></pre>
|
||
<h2><a class="anchor" aria-hidden="true" id="caveats"></a><a href="#caveats" 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>Caveats</h2>
|
||
<p>Not everything you can do with Animated is currently supported in Native Animated. The main limitation is that you can only animate non-layout properties, things like <code>transform</code> and <code>opacity</code> will work but flexbox and position properties won't. Another one is with <code>Animated.event</code>, it will only work with direct events and not bubbling events. This means it does not work with <code>PanResponder</code> but does work with things like <code>ScrollView#onScroll</code>.</p>
|
||
<p>Native Animated has also been part of React Native for quite a while but has never been documented because it was considered experimental. Because of that make sure you are using a recent version (0.40+) of React Native if you want to use this feature.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="resources"></a><a href="#resources" 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>Resources</h2>
|
||
<p>For more information about animated I recommend watching <a href="https://www.youtube.com/watch?v=xtqUJVqpKNo">this talk</a> by <a href="https://twitter.com/Vjeux">Christopher Chedeau</a>.</p>
|
||
<p>If you want a deep dive into animations and how offloading them to native can improve user experience there is also <a href="https://www.youtube.com/watch?v=qgSMjYWqBk4">this talk</a> by <a href="https://twitter.com/kzzzf">Krzysztof Magiera</a>.</p>
|
||
</span></div></article></div><div class="post"><header class="postHeader"><h1 class="postHeaderTitle"><a href="/react-native/blog/2017/01/07/monthly-release-cadence">A Monthly Release Cadence: Releasing December and January RC</a></h1><p class="post-meta">January 7, 2017</p><div class="authorBlock"><p class="post-authorName"><a href="https://twitter.com/EricVicenti" target="_blank" rel="noreferrer noopener">Eric Vicenti</a>Engineer at Facebook</p><div class="authorPhoto authorPhotoBig"><a href="https://twitter.com/EricVicenti" target="_blank" rel="noreferrer noopener"><img src="https://secure.gravatar.com/avatar/077ad5372b65567fe952a99f3b627048?s=128" alt="Eric Vicenti"/></a></div></div></header><article class="post-content"><div><span><p>Shortly after React Native was introduced, we started releasing every two weeks to help the community adopt new features, while keeping versions stable for production use. At Facebook we had to stabilize the codebase every two weeks for the release of our production iOS apps, so we decided to release the open source versions at the same pace. Now, many of the Facebook apps ship once per week, especially on Android. Because we ship from master weekly, we need to keep it quite stable. So the bi-weekly release cadence doesn't even benefit internal contributors anymore.</p>
|
||
<p>We frequently hear feedback from the community that the release rate is hard to keep up with. Tools like <a href="https://expo.io/">Expo</a> had to skip every other release in order to manage the rapid change in version. So it seems clear that the bi-weekly releases did not serve the community well.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="now-releasing-monthly"></a><a href="#now-releasing-monthly" 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>Now releasing monthly</h3>
|
||
<p>We're happy to announce the new monthly release cadence, and the December 2016 release, <code>v0.40</code>, which has been stabilizing for all last month and is ready to adopt. (Just make sure to <a href="https://github.com/facebook/react-native/releases/tag/v0.40.0">update headers in your native modules on iOS</a>).</p>
|
||
<p>Although it may vary a few days to avoid weekends or handle unforeseen issues, you can now expect a given release to be available on the first day of the month, and released on the last.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="use-the-current-month-for-the-best-support"></a><a href="#use-the-current-month-for-the-best-support" 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>Use the current month for the best support</h3>
|
||
<p>The January release candidate is ready to try, and you can <a href="https://github.com/facebook/react-native/releases/tag/v0.41.0-rc.0">see what's new here</a>.</p>
|
||
<p>To see what changes are coming and provide better feedback to React Native contributors, always use the current month's release candidate when possible. By the time each version is released at the end of the month, the changes it contains will have been shipped in production Facebook apps for over two weeks.</p>
|
||
<p>You can easily upgrade your app with the new <a href="http://facebook.github.io/react-native/blog/2016/12/05/easier-upgrades.html">react-native-git-upgrade</a> command:</p>
|
||
<pre><code class="hljs">npm <span class="hljs-keyword">install</span> -g react-<span class="hljs-keyword">native</span>-git-<span class="hljs-keyword">upgrade</span>
|
||
react-<span class="hljs-keyword">native</span>-git-<span class="hljs-keyword">upgrade</span> <span class="hljs-number">0.41</span><span class="hljs-number">.0</span>-rc<span class="hljs-number">.0</span>
|
||
</code></pre>
|
||
<p>We hope this simpler approach will make it easier for the community to keep track of changes in React Native, and to adopt new versions as quickly as possible!</p>
|
||
<p>(Thanks go to <a href="https://github.com/mkonicek">Martin Konicek</a> for coming up with this plan and <a href="https://github.com/grabbou">Mike Grabowski</a> for making it happen)</p>
|
||
</span></div></article></div><div class="post"><header class="postHeader"><h1 class="postHeaderTitle"><a href="/react-native/blog/2016/12/05/easier-upgrades">Easier Upgrades Thanks to Git</a></h1><p class="post-meta">December 5, 2016</p><div class="authorBlock"><p class="post-authorName"><a href="https://twitter.com/ncuillery" target="_blank" rel="noreferrer noopener">Nicolas Cuillery</a>JavaScript consultant and trainer at Zenika</p><div class="authorPhoto authorPhotoBig"><a href="https://twitter.com/ncuillery" target="_blank" rel="noreferrer noopener"><img src="https://fr.gravatar.com/userimage/78328995/184460def705a160fd8edadc04f60eaf.jpg?size=128" alt="Nicolas Cuillery"/></a></div></div></header><article class="post-content"><div><span><p>Upgrading to new versions of React Native has been difficult. You might have seen something like this before:</p>
|
||
<p><img src="/react-native/blog/assets/git-upgrade-conflict.png" alt=""></p>
|
||
<p>None of those options is ideal. By overwriting the file we lose our local changes. By not overwriting we don't get the latest updates.</p>
|
||
<p>Today I am proud to introduce a new tool that helps solve this problem. The tool is called <code>react-native-git-upgrade</code> and uses Git behind the scenes to resolve conflicts automatically whenever possible.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="usage"></a><a href="#usage" 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>Usage</h2>
|
||
<blockquote>
|
||
<p><strong>Requirement</strong>: Git has to be available in the <code>PATH</code>. Your project doesn't have to be managed by Git.</p>
|
||
</blockquote>
|
||
<p>Install <code>react-native-git-upgrade</code> globally:</p>
|
||
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> npm install -g react-native-git-upgrade</span>
|
||
</code></pre>
|
||
<p>or, using <a href="https://yarnpkg.com/">Yarn</a>:</p>
|
||
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> yarn global add react-native-git-upgrade</span>
|
||
</code></pre>
|
||
<p>Then, run it inside your project directory:</p>
|
||
<pre><code class="hljs css language-shell"><span class="hljs-meta">$</span><span class="bash"> <span class="hljs-built_in">cd</span> MyProject</span>
|
||
<span class="hljs-meta">$</span><span class="bash"> react-native-git-upgrade 0.38.0</span>
|
||
</code></pre>
|
||
<blockquote>
|
||
<p>Note: Do <strong>not</strong> run 'npm install' to install a new version of <code>react-native</code>. The tool needs to be able to compare the old and new project template to work correctly. Simply run it inside your app folder as shown above, while still on the old version.</p>
|
||
</blockquote>
|
||
<p>Example output:</p>
|
||
<p><img src="/react-native/blog/assets/git-upgrade-output.png" alt=""></p>
|
||
<p>You can also run <code>react-native-git-upgrade</code> with no arguments to upgrade to the latest version of React Native.</p>
|
||
<p>We try to preserve your changes in iOS and Android build files, so you don't need to run <code>react-native link</code> after an upgrade.</p>
|
||
<p>We have designed the implementation to be as little intrusive as possible. It is entirely based on a local Git repository created on-the-fly in a temporary directory. It won't interfere with your project repository (no matter what VCS you use: Git, SVN, Mercurial, ... or none). Your sources are restored in case of unexpected errors.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="how-does-it-work"></a><a href="#how-does-it-work" 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>How does it work?</h2>
|
||
<p>The key step is generating a Git patch. The patch contains all the changes made in the React Native templates between the version your app is using and the new version.</p>
|
||
<p>To obtain this patch, we need to generate an app from the templates embedded in the <code>react-native</code> package inside your <code>node_modules</code> directory (these are the same templates the <code>react-native init</code> commands uses). Then, after the native apps have been generated from the templates in both the current version and the new version, Git is able to produce a patch that is adapted to your project (i.e. containing your app name):</p>
|
||
<pre><code class="hljs">[...]
|
||
|
||
diff --git a<span class="hljs-meta-keyword">/ios/</span>MyAwesomeApp/Info.plist b<span class="hljs-meta-keyword">/ios/</span>MyAwesomeApp/Info.plist
|
||
index e98ebb0.<span class="hljs-number">.2</span>fb6a11 <span class="hljs-number">100644</span>
|
||
--- a<span class="hljs-meta-keyword">/ios/</span>MyAwesomeApp/Info.plist
|
||
+++ b<span class="hljs-meta-keyword">/ios/</span>MyAwesomeApp/Info.plist
|
||
@@ <span class="hljs-number">-45</span>,<span class="hljs-number">7</span> +<span class="hljs-number">45</span>,<span class="hljs-number">7</span> @@
|
||
<span class="hljs-params"><dict></span>
|
||
<span class="hljs-params"><key></span>localhost<span class="hljs-params"></key></span>
|
||
<span class="hljs-params"><dict></span>
|
||
- <span class="hljs-params"><key></span>NSTemporaryExceptionAllowsInsecureHTTPLoads<span class="hljs-params"></key></span>
|
||
+ <span class="hljs-params"><key></span>NSExceptionAllowsInsecureHTTPLoads<span class="hljs-params"></key></span>
|
||
<span class="hljs-params"><true/></span>
|
||
<span class="hljs-params"></dict></span>
|
||
<span class="hljs-params"></dict></span>
|
||
[...]
|
||
</code></pre>
|
||
<p>All we need now is to apply this patch to your source files. While the old <code>react-native upgrade</code> process would have prompted you for any small difference, Git is able to merge most of the changes automatically using its 3-way merge algorithm and eventually leave us with familiar conflict delimiters:</p>
|
||
<pre><code class="hljs"> <span class="hljs-number">13</span>B07F951A680F5B00A75B9A <span class="hljs-comment">/* Release */</span> = {
|
||
<span class="hljs-attr">isa</span> = XCBuildConfiguration;
|
||
<span class="hljs-attr">buildSettings</span> = {
|
||
<span class="hljs-attr">ASSETCATALOG_COMPILER_APPICON_NAME</span> = AppIcon;
|
||
<<<<<<< ours
|
||
<span class="hljs-attr">CODE_SIGN_IDENTITY</span> = <span class="hljs-string">"iPhone Developer"</span>;
|
||
<span class="hljs-attr">FRAMEWORK_SEARCH_PATHS</span> = (
|
||
<span class="hljs-string">"$(inherited)"</span>,
|
||
<span class="hljs-string">"$(PROJECT_DIR)/HockeySDK.embeddedframework"</span>,
|
||
<span class="hljs-string">"$(PROJECT_DIR)/HockeySDK-iOS/HockeySDK.embeddedframework"</span>,
|
||
);
|
||
=======
|
||
<span class="hljs-attr">CURRENT_PROJECT_VERSION</span> = <span class="hljs-number">1</span>;
|
||
>>>>>>> theirs
|
||
<span class="hljs-attr">HEADER_SEARCH_PATHS</span> = (
|
||
<span class="hljs-string">"$(inherited)"</span>,
|
||
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
|
||
<span class="hljs-string">"$(SRCROOT)/../node_modules/react-native/React/**"</span>,
|
||
<span class="hljs-string">"$(SRCROOT)/../node_modules/react-native-code-push/ios/CodePush/**"</span>,
|
||
);
|
||
</code></pre>
|
||
<p>These conflicts are generally easy to reason about. The delimiter <strong>ours</strong> stands for "your team" whereas <strong>theirs</strong> could be seen as "the React Native team".</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="why-introduce-a-new-global-package"></a><a href="#why-introduce-a-new-global-package" 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>Why introduce a new global package?</h2>
|
||
<p>React Native comes with a global CLI (the <a href="https://www.npmjs.com/package/react-native-cli">react-native-cli</a> package) which delegates commands to the local CLI embedded in the <code>node_modules/react-native/local-cli</code> directory.</p>
|
||
<p>As we mentioned above, the process has to be started from your current React Native version. If we had embedded the implementation in the local-cli, you wouldn't be able to enjoy this feature when using old versions of React Native. For example, you wouldn't be able to upgrade from 0.29.2 to 0.38.0 if this new upgrade code was only released in 0.38.0.</p>
|
||
<p>Upgrading based on Git is a big improvement in developer experience and it is important to make it available to everyone. By using a separate package <a href="https://www.npmjs.com/package/react-native-git-upgrade">react-native-git-upgrade</a> installed globally you can use this new code today no matter what version of React Native your project is using.</p>
|
||
<p>One more reason is the recent <a href="https://twitter.com/martinkonicek/status/800730190141857793">Yeoman wipeout</a> by Martin Konicek. We didn't want to get these Yeoman dependencies back into the <code>react-native</code> package to be able to evaluate the old template in order to create the patch.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="try-it-out-and-provide-feedback"></a><a href="#try-it-out-and-provide-feedback" 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>Try it out and provide feedback</h2>
|
||
<p>As a conclusion, I would say, enjoy the feature and feel free <a href="https://github.com/facebook/react-native/issues">to suggest improvements, report issues</a> and especially <a href="https://github.com/facebook/react-native/pulls">send pull requests</a>. Each environment is a bit different and each React Native project is different, and we need your feedback to make this work well for everyone.</p>
|
||
<h3><a class="anchor" aria-hidden="true" id="thank-you"></a><a href="#thank-you" 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>Thank you!</h3>
|
||
<p>I would like to thank the awesome companies <a href="http://www.zenika.com">Zenika</a> and <a href="http://www.groupem6.fr/le-groupe_en/activites/diversifications/m6-web.html">M6 Web</a> without whom none of this would have been possible!</p>
|
||
</span></div></article></div><div class="post"><header class="postHeader"><h1 class="postHeaderTitle"><a href="/react-native/blog/2016/11/08/introducing-button-yarn-and-a-public-roadmap">Introducing Button, Faster Installs with Yarn, and a Public Roadmap</a></h1><p class="post-meta">November 8, 2016</p><div class="authorBlock"><p class="post-authorName"><a href="https://twitter.com/hectorramos" target="_blank" rel="noreferrer noopener">Héctor Ramos</a>Developer Advocate at Facebook</p><div class="authorPhoto authorPhotoBig"><a href="https://twitter.com/hectorramos" target="_blank" rel="noreferrer noopener"><img src="https://s.gravatar.com/avatar/f2223874e66e884c99087e452501f2da?s=128" alt="Héctor Ramos"/></a></div></div></header><article class="post-content"><div><span><p>We have heard from many people that there is so much work happening with React Native, it can be tough to keep track of what's going on. To help communicate what work is in progress, we are now publishing a <a href="https://github.com/facebook/react-native/wiki/Roadmap">roadmap for React Native</a>. At a high level, this work can be broken down into three priorities:</p>
|
||
<ul>
|
||
<li><strong>Core Libraries</strong>. Adding more functionality to the most useful components and APIs.</li>
|
||
<li><strong>Stability</strong>. Improve the underlying infrastructure to reduce bugs and improve code quality.</li>
|
||
<li><strong>Developer Experience</strong>. Help React Native developers move faster</li>
|
||
</ul>
|
||
<p>If you have suggestions for features that you think would be valuable on the roadmap, check out <a href="https://react-native.canny.io/feature-requests">Canny</a>, where you can suggest new features and discuss existing proposals.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="what-s-new-in-react-native"></a><a href="#what-s-new-in-react-native" 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's new in React Native</h2>
|
||
<p><a href="https://github.com/facebook/react-native/releases/tag/v0.37.0">Version 0.37 of React Native</a>, released today, introduces a new core component to make it really easy to add a touchable Button to any app. We're also introducing support for the new <a href="https://yarnpkg.com/">Yarn</a> package manager, which should speed up the whole process of updating your app's dependencies.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="introducing-button"></a><a href="#introducing-button" 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>Introducing Button</h2>
|
||
<p>Today we're introducing a basic <code><Button /></code> component that looks great on every platform. This addresses one of the most common pieces of feedback we get: React Native is one of the only mobile development toolkits without a button ready to use out of the box.</p>
|
||
<p><img src="/react-native/blog/assets/button-android-ios.png" alt="Simple Button on Android, iOS"></p>
|
||
<pre><code class="hljs"><span class="hljs-tag"><<span class="hljs-name">Button</span>
|
||
<span class="hljs-attr">onPress</span>=<span class="hljs-string">{onPressMe}</span>
|
||
<span class="hljs-attr">title</span>=<span class="hljs-string">"Press Me"</span>
|
||
<span class="hljs-attr">accessibilityLabel</span>=<span class="hljs-string">"Learn more about this Simple Button"</span>
|
||
/></span>
|
||
</code></pre>
|
||
<p>Experienced React Native developers know how to make a button: use TouchableOpacity for the default look on iOS, TouchableNativeFeedback for the ripple effect on Android, then apply a few styles. Custom buttons aren't particularly hard to build or install, but we aim to make React Native radically easy to learn. With the addition of a basic button into core, newcomers will be able to develop something awesome in their first day, rather than spending that time formatting a Button and learning about Touchable nuances.</p>
|
||
<p>Button is meant to work great and look native on every platform, so it won't support all the bells and whistles that custom buttons do. It is a great starting point, but is not meant to replace all your existing buttons. To learn more, check out the <a href="http://facebook.github.io/react-native/button.md">new Button documentation</a>, complete with a runnable example!</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="speed-up-react-native-init-using-yarn"></a><a href="#speed-up-react-native-init-using-yarn" 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>Speed up <code>react-native init</code> using Yarn</h2>
|
||
<p>You can now use <a href="https://yarnpkg.com/">Yarn</a>, the new package manager for JavaScript, to speed up <code>react-native init</code> significantly. To see the speedup please <a href="https://yarnpkg.com/en/docs/install">install yarn</a> and upgrade your <code>react-native-cli</code> to 1.2.0:</p>
|
||
<pre><code class="hljs">$ <span class="hljs-built_in">npm</span> install -g react-<span class="hljs-keyword">native</span>-cli
|
||
</code></pre>
|
||
<p>You should now see “Using yarn” when setting up new apps:</p>
|
||
<p><img src="/react-native/blog/assets/yarn-rncli.png" alt="Using yarn"></p>
|
||
<p>In simple local testing <code>react-native init</code> finished in <strong>about 1 minute on a good network</strong> (vs around 3 minutes when using npm 3.10.8). Installing yarn is optional but highly recommended.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="thank-you"></a><a href="#thank-you" 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>Thank you!</h2>
|
||
<p>We'd like to thank everyone who contributed to this release. The full <a href="https://github.com/facebook/react-native/releases/tag/v0.37.0">release notes</a> are now available on GitHub. With over two dozen bug fixes and new features, React Native just keeps getting better thanks to you.</p>
|
||
</span></div></article></div><div class="post"><header class="postHeader"><h1 class="postHeaderTitle"><a href="/react-native/blog/2016/10/25/0.36-headless-js-the-keyboard-api-and-more">0.36: Headless JS, the Keyboard API, & more</a></h1><p class="post-meta">October 25, 2016</p><div class="authorBlock"><p class="post-authorName"><a href="https://twitter.com/hectorramos" target="_blank" rel="noreferrer noopener">Héctor Ramos</a>Developer Advocate at Facebook</p><div class="authorPhoto authorPhotoBig"><a href="https://twitter.com/hectorramos" target="_blank" rel="noreferrer noopener"><img src="https://s.gravatar.com/avatar/f2223874e66e884c99087e452501f2da?s=128" alt="Héctor Ramos"/></a></div></div></header><article class="post-content"><div><span><p>Today we are releasing <a href="https://github.com/facebook/react-native/releases/tag/v0.36.0">React Native 0.36</a>. Read on to learn more about what's new.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="headless-js"></a><a href="#headless-js" 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>Headless JS</h2>
|
||
<p>Headless JS is a way to run tasks in JavaScript while your app is in the background. It can be used, for example, to sync fresh data, handle push notifications, or play music. It is only available on Android, for now.</p>
|
||
<p>To get started, define your async task in a dedicated file (e.g. <code>SomeTaskName.js</code>):</p>
|
||
<pre><code class="hljs css language-javascript">module<span class="token punctuation">.</span>exports <span class="token operator">=</span> <span class="token keyword">async</span> <span class="token punctuation">(</span>taskData<span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>
|
||
<span class="token comment">// Perform your task here.</span>
|
||
<span class="token punctuation">}</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Next, register your task in on <code>AppRegistry</code>:</p>
|
||
<pre><code class="hljs css language-javascript">AppRegistry<span class="token punctuation">.</span><span class="token function">registerHeadlessTask</span><span class="token punctuation">(</span><span class="token string">'SomeTaskName'</span><span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'SomeTaskName'</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<p>Using Headless JS does require some native Java code to be written in order to allow you to start up the service when needed. Take a look at our new <a href="/react-native/headless-js-android.md">Headless JS docs</a> to learn more!</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="the-keyboard-api"></a><a href="#the-keyboard-api" 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>The Keyboard API</h2>
|
||
<p>Working with the on-screen keyboard is now easier with <a href="/react-native/keyboard.md"><code>Keyboard</code></a>. You can now listen for native keyboard events and react to them. For example, to dismiss the active keyboard, simply call <code>Keyboard.dismiss()</code>:</p>
|
||
<pre><code class="hljs css language-js"><span class="token keyword">import</span> <span class="token punctuation">{</span>Keyboard<span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'react-native'</span><span class="token punctuation">;</span>
|
||
|
||
<span class="token comment">// Hide that keyboard!</span>
|
||
Keyboard<span class="token punctuation">.</span><span class="token function">dismiss</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
|
||
</code></pre>
|
||
<h2><a class="anchor" aria-hidden="true" id="animated-division"></a><a href="#animated-division" 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>Animated Division</h2>
|
||
<p>Combining two animated values via addition, multiplication, and modulo are already supported by React Native. With version 0.36, combining two <a href="/react-native/animated.md#divide">animated values via division</a> is now possible. There are some cases where an animated value needs to invert another animated value for calculation. An example is inverting a scale (2x --> 0.5x):</p>
|
||
<pre><code class="hljs">const a = Animated.Value(<span class="hljs-number">1</span>)<span class="hljs-comment">;</span>
|
||
const <span class="hljs-keyword">b </span>= Animated.<span class="hljs-keyword">divide(1, </span>a)<span class="hljs-comment">;</span>
|
||
|
||
Animated.spring(a, {
|
||
<span class="hljs-symbol"> toValue:</span> <span class="hljs-number">2</span>,
|
||
}).start()<span class="hljs-comment">;</span>
|
||
</code></pre>
|
||
<p><code>b</code> will then follow <code>a</code>'s spring animation and produce the value of <code>1 / a</code>.</p>
|
||
<p>The basic usage is like this:</p>
|
||
<pre><code class="hljs"><Animated.View <span class="hljs-built_in">style</span>={{<span class="hljs-built_in">transform</span>: [{<span class="hljs-built_in">scale</span>: a}]}}>
|
||
<Animated.Image <span class="hljs-built_in">style</span>={{<span class="hljs-built_in">transform</span>: [{<span class="hljs-built_in">scale</span>: b}]}} />
|
||
<Animated.View>
|
||
</code></pre>
|
||
<p>In this example, the inner image won't get stretched at all because the parent's scaling gets cancelled out. If you'd like to learn more, check out the <a href="/react-native/animations.md">Animations guide</a>.</p>
|
||
<h2><a class="anchor" aria-hidden="true" id="dark-status-bars"></a><a href="#dark-status-bars" 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>Dark Status Bars</h2>
|
||
<p>A new <code>barStyle</code> value has been added to <code>StatusBar</code>: <code>dark-content</code>. With this addition, you can now use <a href="/react-native/statusbar.md#barstyle"><code>barStyle</code></a> on both iOS and Android. The behavior will now be the following:</p>
|
||
<ul>
|
||
<li><code>default</code>: Use the platform default (light on iOS, dark on Android).</li>
|
||
<li><code>light-content</code>: Use a light status bar with black text and icons.</li>
|
||
<li><code>dark-content</code>: Use a dark status bar with white text and icons.</li>
|
||
</ul>
|
||
<h2><a class="anchor" aria-hidden="true" id="and-more"></a><a href="#and-more" 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>...and more</h2>
|
||
<p>The above is just a sample of what has changed in 0.36. Check out the <a href="https://github.com/facebook/react-native/releases/tag/v0.36.0">release notes on GitHub</a> to see the full list of new features, bug fixes, and breaking changes.</p>
|
||
<p>You can upgrade to 0.36 by running the following commands in a terminal:</p>
|
||
<pre><code class="hljs css language-bash">$ npm install --save react-native@0.36
|
||
$ react-native upgrade
|
||
</code></pre>
|
||
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev" href="/react-native/blog/page2/">← Prev</a><a class="docs-next" href="/react-native/blog/page4/">Next →</a></div></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>Community</h5><a href="/react-native/help.html">The React Native Community</a><a href="/react-native/showcase.html">Who's using React Native?</a><a href="http://stackoverflow.com/questions/tagged/react-native" target="_blank">Ask Questions on Stack Overflow</a><a href="https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md">Contributor Guide</a></div><div><h5>More Resources</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 © 2019 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>
|
||
document.addEventListener('keyup', function(e) {
|
||
if (e.target !== document.body) {
|
||
return;
|
||
}
|
||
// keyCode for '/' (slash)
|
||
if (e.keyCode === 191) {
|
||
const search = document.getElementById('search_input_react');
|
||
search && search.focus();
|
||
}
|
||
});
|
||
</script><script>
|
||
var search = docsearch({
|
||
|
||
apiKey: '2c98749b4a1e588efec53b2acec13025',
|
||
indexName: 'react-native-versions',
|
||
inputSelector: '#search_input_react',
|
||
algoliaOptions: {"facetFilters":["tags:0.60-RC"],"hitsPerPage":5}
|
||
});
|
||
</script></body></html> |