Compile with:
webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.js
Use with the following index.html
function dobro(n) { | |
if (typeof(n) != "number") return 0; // se n não é um número retorne 0 | |
return n * 2; | |
} | |
document.write(dobro(2)); // ok, imprime 4 | |
document.write(dobro("t")); // ok, "t" não é do tipo number, então imprime 0 |
import * as React from 'react'; | |
import { withRouter } from 'react-router-dom'; | |
import { isLoggedIn } from '../../security/authentication'; | |
import routeTo from '../utils/routeTo'; | |
const authenticatedMiddleware = Component => { | |
class AuthenticatedMiddleware extends React.PureComponent { | |
componentDidMount() { | |
this.redirectIfNotAuthenticated(); |
<AppRouter | |
ref={stackNavigatorRef => NavigatorService.setContainer(stackNavigatorRef)} | |
screenProps={{ | |
t, | |
theme, | |
}} | |
{...getPersistenceFunctions(navigationPersistenceKey)} | |
/> |
function adb_connect { | |
# PORT used to connect. Default: 5555 | |
PORT=${1:-5555} | |
# IP address from current device connected | |
IP_ADDRESS=`adb shell ip route | awk '{print $9}'` | |
echo "ADB connect to $IP_ADDRESS on port $PORT" | |
# Change connection from usb to tcpip using $PORT |
/** | |
* Metro configuration for React Native | |
* https://github.com/facebook/react-native | |
* | |
* @format | |
*/ | |
const path = require('path'); | |
const { FileStore } = require('metro-cache'); |
{"lastUpload":"2018-12-19T18:25:14.965Z","extensionVersion":"v3.2.4"} |
Compile with:
webpack --config vendor.webpack.config.js
webpack --config app.webpack.config.js
Use with the following index.html
import React, { Component } from "react"; | |
import { render } from "react-dom"; | |
import "./index.css"; | |
class Widget extends Component { | |
state = { text: "" }; | |
handleChange = (e) => { | |
this.setState({ text: e.target.value }); | |
}; | |
render() { |
// web/webpack.config.js | |
const path = require('path'); | |
const webpack = require('webpack'); | |
const appDirectory = path.resolve(__dirname, '../'); | |
// This is needed for webpack to compile JavaScript. | |
// Many OSS React Native packages are not compiled to ES5 before being | |
// published. If you depend on uncompiled packages they may cause webpack build |