Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds forward compatibility with RN > 0.40 and #29

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions ios/RCTToast/Toast.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
#import <UIKit/UIKit.h>
#import <React/RCTLog.h>
#import <React/RCTBridgeModule.h>
#import "Toast+UIView.h"

#if __has_include(<React/RCTAssert.h>)
#import <React/RCTLog.h>
#import <React/RCTBridgeModule.h>
#else // back compatibility for RN version < 0.40
#import "RCTLog.h"
#import "RCTBridgeModule.h"
#endif

@interface Toast : NSObject <RCTBridgeModule>
@end
Expand All @@ -11,7 +16,6 @@ @implementation Toast

RCT_EXPORT_MODULE(Toast)


RCT_EXPORT_METHOD(show:(NSDictionary *)options) {
NSString *message = [options objectForKey:@"message"];
NSString *duration = [options objectForKey:@"duration"];
Expand Down