mirror of
https://github.com/zhigang1992/react-native-web.git
synced 2026-03-30 23:23:35 +08:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b195f2b1f5 | ||
|
|
7b81d2a7ec | ||
|
|
a1d8ea776e | ||
|
|
15b960f097 | ||
|
|
001be82178 | ||
|
|
5eeef9e3d2 |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"version": "0.8.0",
|
||||
"version": "0.8.2",
|
||||
"name": "react-native-web-monorepo",
|
||||
"scripts": {
|
||||
"clean": "del ./packages/*/dist",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "babel-plugin-react-native-web",
|
||||
"version": "0.8.0",
|
||||
"version": "0.8.2",
|
||||
"description": "Babel plugin for React Native for Web",
|
||||
"main": "index.js",
|
||||
"devDependencies": {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "benchmarks",
|
||||
"version": "0.8.0",
|
||||
"version": "0.8.2",
|
||||
"scripts": {
|
||||
"build": "mkdir -p dist && cp -f index.html dist/index.html && ./node_modules/.bin/webpack-cli --config ./webpack.config.js",
|
||||
"release": "yarn build && git checkout gh-pages && rm -rf ../../benchmarks && mv dist ../../benchmarks && git add -A && git commit -m \"Benchmarks deploy\" && git push origin gh-pages && git checkout -"
|
||||
@@ -18,7 +18,7 @@
|
||||
"react-dom": "^16.3.2",
|
||||
"react-fela": "^7.2.0",
|
||||
"react-jss": "^8.4.0",
|
||||
"react-native-web": "0.8.0",
|
||||
"react-native-web": "0.8.2",
|
||||
"reactxp": "^1.1.1",
|
||||
"styled-components": "^3.2.6",
|
||||
"styled-jsx": "^2.2.6",
|
||||
@@ -26,7 +26,7 @@
|
||||
"styletron-react": "^4.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-react-native-web": "0.8.0",
|
||||
"babel-plugin-react-native-web": "0.8.2",
|
||||
"css-loader": "^0.28.11",
|
||||
"style-loader": "^0.21.0",
|
||||
"url-loader": "^1.0.1",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "react-native-examples",
|
||||
"version": "0.8.0",
|
||||
"version": "0.8.2",
|
||||
"scripts": {
|
||||
"build": "mkdir -p dist && cp -f src/index.html dist/index.html && ./node_modules/.bin/webpack-cli --config ./webpack.config.js",
|
||||
"release": "yarn build && git checkout gh-pages && rm -rf ../../examples && mv dist ../../examples && git add -A && git commit -m \"Examples deploy\" && git push origin gh-pages && git checkout -"
|
||||
@@ -10,10 +10,10 @@
|
||||
"babel-runtime": "^6.26.0",
|
||||
"react": "^16.3.2",
|
||||
"react-dom": "^16.3.2",
|
||||
"react-native-web": "0.8.0"
|
||||
"react-native-web": "0.8.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-react-native-web": "0.8.0",
|
||||
"babel-plugin-react-native-web": "0.8.2",
|
||||
"babel-plugin-transform-runtime": "^6.23.0",
|
||||
"file-loader": "^1.1.11",
|
||||
"webpack": "^4.8.1",
|
||||
|
||||
@@ -29,7 +29,7 @@ class BasicStorageExample extends React.Component<{}, $FlowFixMeState> {
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this._loadInitialState().done();
|
||||
this._loadInitialState()//.done();
|
||||
}
|
||||
|
||||
_loadInitialState = async () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "react-native-web",
|
||||
"version": "0.8.0",
|
||||
"version": "0.8.2",
|
||||
"description": "React Native for Web",
|
||||
"module": "dist/index.js",
|
||||
"main": "dist/cjs/index.js",
|
||||
|
||||
@@ -91,14 +91,16 @@ export default class AppRegistry {
|
||||
|
||||
static runApplication(appKey: string, appParameters: Object): void {
|
||||
const isDevelopment = process.env.NODE_ENV !== 'production';
|
||||
const params = { ...appParameters };
|
||||
params.rootTag = `#${params.rootTag.id}`;
|
||||
if (isDevelopment) {
|
||||
const params = { ...appParameters };
|
||||
params.rootTag = `#${params.rootTag.id}`;
|
||||
|
||||
console.log(
|
||||
`Running application "${appKey}" with appParams: ${JSON.stringify(params)}.\n` +
|
||||
`Development-level warnings: ${isDevelopment ? 'ON' : 'OFF'}.\n` +
|
||||
`Performance optimizations: ${isDevelopment ? 'OFF' : 'ON'}.`
|
||||
);
|
||||
console.log(
|
||||
`Running application "${appKey}" with appParams: ${JSON.stringify(params)}.\n` +
|
||||
`Development-level warnings: ${isDevelopment ? 'ON' : 'OFF'}.\n` +
|
||||
`Performance optimizations: ${isDevelopment ? 'OFF' : 'ON'}.`
|
||||
);
|
||||
}
|
||||
|
||||
invariant(
|
||||
runnables[appKey] && runnables[appKey].run,
|
||||
|
||||
@@ -50,6 +50,7 @@ const adjustProps = domProps => {
|
||||
|
||||
const isButtonRole = role === 'button';
|
||||
const isDisabled = AccessibilityUtil.isDisabled(domProps);
|
||||
const isLinkRole = role === 'link';
|
||||
|
||||
Object.keys(domProps).forEach(propName => {
|
||||
const prop = domProps[propName];
|
||||
@@ -67,11 +68,11 @@ const adjustProps = domProps => {
|
||||
}
|
||||
});
|
||||
|
||||
// Cancel click events if the responder system is being used. Click events
|
||||
// are not an expected part of the React Native API, and browsers dispatch
|
||||
// click events that cannot otherwise be cancelled from preceding mouse
|
||||
// events in the responder system.
|
||||
if (onResponderRelease) {
|
||||
// Cancel click events if the responder system is being used on a link
|
||||
// element. Click events are not an expected part of the React Native API,
|
||||
// and browsers dispatch click events that cannot otherwise be cancelled from
|
||||
// preceding mouse events in the responder system.
|
||||
if (isLinkRole && onResponderRelease) {
|
||||
domProps.onClick = function(e) {
|
||||
if (!e.isDefaultPrevented() && !isModifiedEvent(e.nativeEvent) && !domProps.target) {
|
||||
e.preventDefault();
|
||||
|
||||
2
packages/react-native-web/src/index.js
vendored
2
packages/react-native-web/src/index.js
vendored
@@ -83,7 +83,7 @@ const ImageStore = UnimplementedView;
|
||||
const InputAccessoryView = UnimplementedView;
|
||||
const MaskedViewIOS = UnimplementedView;
|
||||
const NavigatorIOS = UnimplementedView;
|
||||
const PickerIOS = UnimplementedView;
|
||||
const PickerIOS = Picker;
|
||||
const ProgressBarAndroid = UnimplementedView;
|
||||
const ProgressViewIOS = UnimplementedView;
|
||||
const SegmentedControlIOS = UnimplementedView;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "website",
|
||||
"version": "0.8.0",
|
||||
"version": "0.8.2",
|
||||
"scripts": {
|
||||
"build": "build-storybook -o ./dist -c ./storybook/.storybook",
|
||||
"start": "start-storybook -p 9001 -c ./storybook/.storybook",
|
||||
@@ -12,10 +12,10 @@
|
||||
"@storybook/react": "^3.4.3",
|
||||
"react": "^16.3.2",
|
||||
"react-dom": "^16.3.2",
|
||||
"react-native-web": "0.8.0"
|
||||
"react-native-web": "0.8.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-plugin-react-native-web": "0.8.0",
|
||||
"babel-plugin-react-native-web": "0.8.2",
|
||||
"url-loader": "^1.0.1",
|
||||
"webpack": "^4.8.1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user