mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Updates from Fri 13 Mar
- [ReactNative] Oss ActionSheet | Tadeu Zagallo - [ReactNative] Fix ScrollView.scrollTo() | Christopher Chedeau - [catalyst|madman] fix location observer | Jiajie Zhu - [ReactNative] Remove keyboardDismissMode from static | Christopher Chedeau - [ReactNative] Fix RCTMapManager retaining cycle | Tadeu Zagallo - [ReactNative] Support loading sourcemaps from sourceMappingURL | Alex Kotliarskyi - [catalyst] set up directory specific rql transform | Bhuwan Khattar - [React Native] Add .done() to terminate promise chains | Ben Alpert - [React Native] add support for reading tracking bit | Owen Coutts
This commit is contained in:
12
ReactKit/Modules/RCTSourceCode.h
Normal file
12
ReactKit/Modules/RCTSourceCode.h
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "RCTBridgeModule.h"
|
||||
|
||||
@interface RCTSourceCode : NSObject <RCTBridgeModule>
|
||||
|
||||
@property (nonatomic, copy) NSString *scriptText;
|
||||
@property (nonatomic, copy) NSURL *scriptURL;
|
||||
|
||||
@end
|
||||
21
ReactKit/Modules/RCTSourceCode.m
Normal file
21
ReactKit/Modules/RCTSourceCode.m
Normal file
@@ -0,0 +1,21 @@
|
||||
// Copyright 2004-present Facebook. All Rights Reserved.
|
||||
|
||||
#import "RCTSourceCode.h"
|
||||
|
||||
#import "RCTAssert.h"
|
||||
#import "RCTUtils.h"
|
||||
|
||||
@implementation RCTSourceCode
|
||||
|
||||
- (void)getScriptText:(RCTResponseSenderBlock)successCallback failureCallback:(RCTResponseSenderBlock)failureCallback
|
||||
{
|
||||
RCT_EXPORT();
|
||||
if (self.scriptText && self.scriptURL) {
|
||||
successCallback(@[@{@"text": self.scriptText, @"url":[self.scriptURL absoluteString]}]);
|
||||
} else {
|
||||
failureCallback(@[RCTMakeError(@"Source code is not available", nil, nil)]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user