From 43231c0524d3066b4a01fcad2c8e2d8ee40df564 Mon Sep 17 00:00:00 2001 From: Devin Abbott Date: Tue, 5 Jul 2016 20:00:38 -0700 Subject: [PATCH] Update web player and add it to UsingAListView docs page. Summary: Update web player (which now uses 0.0.29 of react-native-web) to support ListView. lacker **Test plan (required)** ![screen shot 2016-07-05 at 7 15 08 pm](https://cloud.githubusercontent.com/assets/1198882/16605576/10f80956-42e5-11e6-8b19-4b8242625d23.png) Closes https://github.com/facebook/react-native/pull/8591 Differential Revision: D3521276 Pulled By: JoelMarcey fbshipit-source-id: 896a7ee77b9592f7cf95d6d48e5f4ddea76f5f07 --- docs/UsingAListView.md | 4 ++-- website/core/WebPlayer.js | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/UsingAListView.md b/docs/UsingAListView.md index 1c3b9d689..4db766ab4 100644 --- a/docs/UsingAListView.md +++ b/docs/UsingAListView.md @@ -17,7 +17,7 @@ This example creates a simple `ListView` of hardcoded data. It first initializes > A `rowHasChanged` function is required to use `ListView`. Here we just say a row has changed if the row we are on is not the same as the previous row. -```JavaScript +```ReactNativeWebPlayer import React, { Component } from 'react'; import { AppRegistry, ListView, Text, View } from 'react-native'; @@ -45,7 +45,7 @@ class ListViewBasics extends Component { } // App registration and rendering -AppRegistry.registerComponent('AwesomeProject', () => ListViewBasics); +AppRegistry.registerComponent('ListViewBasics', () => ListViewBasics); ``` One of the most common uses for a `ListView` is displaying data that you fetch from a server. To do that, you will need to [learn about networking in React Native](/react-native/docs/network.html). diff --git a/website/core/WebPlayer.js b/website/core/WebPlayer.js index 76b51ad4f..2ea320bf8 100644 --- a/website/core/WebPlayer.js +++ b/website/core/WebPlayer.js @@ -12,6 +12,8 @@ var React = require('React'); var Prism = require('Prism'); +var WEB_PLAYER_VERSION = '1.1.0'; + /** * Use the WebPlayer by including a ```ReactNativeWebPlayer``` block in markdown. * @@ -57,7 +59,7 @@ var WebPlayer = React.createClass({ style={{marginTop: 4}} width='880' height={this.parseParams(this.props.params).platform === 'android' ? '425' : '420'} - data-src={`//npmcdn.com/react-native-web-player@1.0.0/index.html${hash}`} + data-src={`//npmcdn.com/react-native-web-player@${WEB_PLAYER_VERSION}/index.html${hash}`} frameBorder='0' />