Jay.M.Hu

Results 50 issues of Jay.M.Hu

# Collection the react native questions. ## 1. TouchableWithoutFeedback onPress 不生效? **原因分析:** TouchableWithoutFeedback 需要 \ 作为直接子集,如果children不是\,则不会生效,举例如下: ```jsx const Hello = props => Hello; // Not working alert('working')}> // Working alert('working')}>...

```js function lengthOfLongestSubstring(text) { function hasRepeatChar(str) { var strArr = str.split(''); var obj = {}; strArr.forEach(x => (obj[x] = true)); return strArr.length != Object.keys(obj).length; } var longStr = ''; var...

```js class Map { constructor() { this.$keyObj = {}; this.$valueObj = {}; this.$length = 0; } set(key, value) { const autoKey = `key${Map.idx++}`; this.$keyObj[autoKey] = key; this.$valueObj[autoKey] = value; //...

放在 ``` http { } ``` 中, ``` gzip on; gzip_min_length 1k; gzip_buffers 16 64k; gzip_http_version 1.1; gzip_comp_level 4; gzip_types text/plain application/javascript text/css application/xml; gzip_vary on; ```

``` apt-get update -qq > /dev/null # 安装依赖库 apt-get update && apt-get install -y --no-install-recommends apt-utils > /dev/null apt-get install -qq --no-install-recommends \ build-essential \ autoconf \ curl \ git...

在根目录新建:`.prettierrc.js`,内容如下: ``` module.exports = { parser: 'babylon', printWidth: 120, // 每行最大120字符 semi: true, // 末尾分号 singleQuote: true, // 使用单引号 overrides: [ { files: ['*.json', '.eslintrc', '.tslintrc', '.prettierrc', '.tern-project'], options: {...

```js "importSort": { ".js, .jsx, .es6, .es,": { "parser": "babylon", "style": "module-compact" }, ".ts, .tsx": { "parser": "typescript", "style": "eslint", "options": {} } }, ``` 配置到package.json中。

1. [detox](https://github.com/wix/detox) 灰盒端到端自动化测试框架 2.

```js import { connect } from 'react-redux'; import { combineReducers, createStore } from 'redux'; const reducerMap = {}; export const reduxHelper = { store: null, // 缓存全局store _isFunction(fn) { return...

```bash 0. mv a/submodule a/submodule_tmp 1. git submodule deinit -f -- a/submodule 2. rm -rf .git/modules/a/submodule 3. git rm -f a/submodule # Note: a/submodule (no trailing slash,尾巴上没有斜杠) # or, if...