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
/* eslint-disable react-native/no-inline-styles */ | |
/** | |
* Sample React Native App | |
* https://github.com/facebook/react-native | |
* | |
* @format | |
* @flow | |
*/ | |
import React from 'react'; |
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
const cache = {} | |
export default function useGlobalMemo (key, fn, deps) { | |
if (!cache[key]) { | |
cache[key] = { | |
subs: 0, | |
deps, | |
value: fn(), | |
} |
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/RCTViewManager.h> | |
@interface RCT_EXTERN_MODULE(CounterManager, RCTViewManager) | |
RCT_EXPORT_VIEW_PROPERTY(value, NSNumber) | |
RCT_EXPORT_VIEW_PROPERTY(leftButtonText, NSString) | |
RCT_EXPORT_VIEW_PROPERTY(rightButtonText, NSString) | |
RCT_EXPORT_VIEW_PROPERTY(onPressLeftButton, RCTDirectEventBlock) | |
RCT_EXPORT_VIEW_PROPERTY(onPressRightButton, RCTDirectEventBlock) |
OlderNewer