A framework for building native Windows apps with React.
Перейти к файлу
Eric Rozell b33642b885 feat(TouchHandler): Add pointerType info to touch event data (#773)
Adds a pointerType field to the native event for the gesture responder handlers. Basically, e.nativeEvent.pointerType is oneOf ["mouse", "pen", "touch"].  I'll need to follow up with documentation and examples for this.

Adds behavior to serialize button information from the pointer event. E.g., a right-click will result in `isRightButton: true` on the pointer event data, similar to `isLeftButton` and `isMiddleButton` for left and middle buttons respectively. When using the pen, there is `isEraser` and `isBarrelButtonPressed`, as well as a `force` field (similar to the iOS 3D touch API) for press firmness.

Each of these fields are not serialized if they are `false`, which will be the case for the majority of them most of the time (i.e., there is no impact on serialized data payload for touch, but a slight penalty for enumerating the properties at serialization time). *With the exception of `isLeftButton` and `force`, which is omnipresent in all the pointer event payloads.

I don't believe this is a complete solution for right-click handling, but, in theory, building a proper API to support right-click and context menus could be built as JavaScript components on top of these layers.

Fixes #772
Fixes #774
2016-10-13 12:31:59 -04:00
.github
Examples@7c4f6bb560 chore(Examples): point at latest examples commit. 2016-10-03 15:56:03 -04:00
Libraries fix(Packager): Adds platform-specific files to satisfy packager (#721) 2016-09-26 15:38:02 -04:00
ReactWindows feat(TouchHandler): Add pointerType info to touch event data (#773) 2016-10-13 12:31:59 -04:00
docs Update RunningOnDeviceWindows.md (#677) 2016-09-08 10:24:01 -04:00
local-cli fix(BundleConfig): MainPage.cs should disable dev options for ReleaseBundle config (#753) 2016-10-07 13:51:35 -04:00
.editorconfig feat(EditorConfig) - closes Issue #468 (#471) 2016-06-13 11:22:18 -04:00
.eslintignore feat(ESLint) - add ESLint - Closes Issue #469 (#472) 2016-06-13 11:35:49 -04:00
.eslintrc feat(ESLint) - add ESLint - Closes Issue #469 (#472) 2016-06-13 11:35:49 -04:00
.gitignore Implement ChakraBridge in C++ (#584) 2016-08-22 11:38:33 -04:00
.gitmodules Update .gitmodules 2016-08-01 10:34:28 -04:00
LICENSE
README.md Update README.md 2016-09-22 11:37:58 -04:00
logo.png
package.json feat(Portable): Start shared project - Minimal (#723) 2016-09-30 23:10:59 -04:00

README.md

React Native plugin for Universal Windows Platform (UWP)

Hero Image with Logo

React Native enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React. The focus of React Native is on developer efficiency across all the platforms you care about - learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native.

This repository adds support for the Windows 10 SDK, which allows you to build apps for:

Introduction

See the official React Native website for an introduction to React Native.

Getting Started

  • Follow the Getting Started guide to install React Native and its dependencies.
  • Change your working directory to the project directory you specified in the react-native init command from the Getting Started guide (e.g., cd AwesomeProject).
  • Install rnpm-plugin-windows from NPM (i.e., npm install --save-dev rnpm-plugin-windows).
  • Initialize Windows project with react-native windows command in the project directory.
  • Learn more about various tools for debugging React Native.

Requirements

In addition to the requirements from the Getting Started guide:

If this is your first time using UWP, you may be able to install the SDK by opening the solution file in the ReactWindows folder in Visual Studio. After opening the solution, right click the Solution in the Solution Explorer and select the option labeled "Install Missing Components". You may have to shutdown Visual Studio to continue the installation.

Getting Help

Please use these community resources for getting help. We use the GitHub issues for tracking bugs and feature requests and have limited bandwidth to address them.

  • Chat with us on Reactiflux in #react-native-platforms
  • If it turns out that you may have found a bug, please open an issue

Documentation

React Native already has great documentation, and we're working to ensure the React Native Windows plugin is part of that documentation story. Check out the React documentation for further details about the React API in general.

For information on parity status with Android and iOS, including details on implemented and missing components and modules, along with related issues for missing features from partial implementations, go here.

Examples

git clone --recursive https://github.com/ReactWindows/react-native-windows.git
cd react-native-windows
npm install

Running the examples

  • Start the React Native packager by running react-native start
  • Open Examples.sln from the Examples submodule folder in Visual Studio.
  • Set the StartUp project to the example you want to run, press F5.

Extending React Native

  • Looking for a component? JS.coach
  • Fellow developers write and publish React Native modules to npm and open source them on GitHub.
  • Many third party modules may be missing Windows support, so reach out to the project owners directly.
  • Making modules helps grow the React Native ecosystem and community. We recommend writing modules for your use cases and sharing them on npm.
  • Read the guides on Native Modules for Windows (Coming Soon) and Native UI Components for Windows (Coming Soon) if you are interested in extending native functionality.

Opening Issues

If you encounter a bug with the React Native Windows plugin, we would like to hear about it. Search the existing issues and try to make sure your problem doesnt already exist before opening a new issue. Its helpful if you include the version of React Native, React Native Windows plugin, and device family (i.e., mobile, desktop, Xbox, etc.) youre using. Please include a stack trace and reduced repro case when appropriate, too.

The GitHub issues are intended for bug reports and feature requests. For help and questions with using the React Native Windows plugin please make use of the resources listed in the Getting Help section. There are limited resources available for handling issues and by keeping the list of open issues lean we can respond in a timely manner.

FAQs

  1. Running react-native windows fails with No compatible version found: react-native-windows@0.x.*

We try to keep up-to-date with the latest version of react-native, but sometimes we fall a bit behind. The default behavior of the Windows init RNPM plugin is to try and install the version of react-native-windows that matches the version of react-native that you're using (from the package.json file of your project). Often times, an older version of react-native-windows will work just fine with a later version of react-native, so a good first attempt is to try and select the latest (or release candidate) version of react-native-windows using the --windowsVersion flag. E.g.,

react-native windows --windowsVersion 0.x.0-rc.0

Where x is the version of react-native you have installed.

Contributing

For more information about contributing PRs and issues, see our Contribution Guidelines (Coming Soon).

Good First Task and help wanted are great starting points for PRs.

We're still working on our CI story. In the meantime, please be sure to run the unit tests in Visual Studio before submitting pull requests.

License

The React Native Windows plugin is provided under the MIT License.

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.