This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Alert } from "react-native"; | |
export default function() { | |
require("promise/setimmediate/rejection-tracking").enable({ | |
allRejections: true, | |
onUnhandled: (id, error = {}) => { | |
let message; | |
let stack; | |
const stringValue = Object.prototype.toString.call(error); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Calling .blur() in the test renderer environment is not supported. Instead, mock out your | |
// components that use findNodeHandle with replacements that don't rely on the native environment. | |
jest.mock("TextInput", () => { | |
const RealComponent = require.requireActual("TextInput"); | |
const React = require("react"); | |
// eslint-disable-next-line react/prefer-stateless-function | |
class TextInput extends React.Component { | |
render() { | |
return React.createElement("TextInput", this.props, this.props.children); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension String { | |
func camelCaseToSnakeCase() -> String { | |
let acronymPattern = "([A-Z]+)([A-Z][a-z]|[0-9])" | |
let normalPattern = "([a-z0-9])([A-Z])" | |
return self.processCamalCaseRegex(pattern: acronymPattern)? | |
.processCamalCaseRegex(pattern: normalPattern)?.lowercased() ?? self.lowercased() | |
} | |
fileprivate func processCamalCaseRegex(pattern: String) -> String? { | |
let regex = try? NSRegularExpression(pattern: pattern, options: []) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import PropTypes from "prop-types"; | |
const Then = ({ children }) => children; | |
Then.propTypes = { | |
children: PropTypes.node.isRequired | |
}; | |
const If = ({ condition, children }) => { |
OlderNewer