Skip to content

Commit

Permalink
Merge pull request #725 from plaid/dt-v12-revamp
Browse files Browse the repository at this point in the history
v12 Prep
  • Loading branch information
dtroupe-plaid authored Nov 15, 2024
2 parents 84de474 + f41cc8b commit efea459
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 322 deletions.
7 changes: 5 additions & 2 deletions example/src/Screens/PlaidLinkScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ export function PlaidLinkScreen() {
const [disabled, setDisabled] = React.useState(true);

const iOSVersionParts = String(Platform.Version).split('.');
const [majorVersion, minorVersion, patchVersion] =
iOSVersionParts.length === 3 ? iOSVersionParts : [null, null, null];
const [majorVersion, minorVersion] =
iOSVersionParts.length >= 2 ? iOSVersionParts : [null, null];

const financeKitText = () => {
if (majorVersion && minorVersion) {
Expand All @@ -89,6 +89,9 @@ export function PlaidLinkScreen() {
</Text>
);
}
} else {
// Fallback return if majorVersion or minorVersion are not provided.
return <Text style={styles.button}>Invalid iOS version</Text>;
}
};

Expand Down
15 changes: 14 additions & 1 deletion ios/PLKEmbeddedViewComponentView.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
#ifdef RCT_NEW_ARCH_ENABLED

#import <UIKit/UIKit.h>

#import <React/RCTUIManager.h>
#import <React/RCTViewComponentView.h>

NS_ASSUME_NONNULL_BEGIN

/**
* This file is required for compatibility with React Native's New Architecture (Fabric Renderer).
*
* - PLKEmbeddedViewComponentView extends `RCTViewComponentView` to define a custom native view
* that works with the Fabric rendering system, improving UI performance and concurrency.
* - The `#ifdef RCT_NEW_ARCH_ENABLED` directive ensures this code is only compiled when the
* New Architecture is enabled, avoiding compatibility issues with older architectures.
* - Custom native views like this are essential when integrating UIKit-based components into
* React Native apps under the New Architecture.
* - `RCTUIManager` handles the interaction between the native view and the React Native bridge,
* enabling updates and commands from the JavaScript side.
*
* Ref - https://github.com/reactwg/react-native-new-architecture/blob/main/docs/backwards-compat-turbo-modules.md
*/
@interface PLKEmbeddedViewComponentView : RCTViewComponentView
@end

Expand Down
300 changes: 0 additions & 300 deletions ios/RNLinksdk.xcodeproj/project.pbxproj

This file was deleted.

10 changes: 0 additions & 10 deletions ios/RNLinksdk.xcworkspace/contents.xcworkspacedata

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion react-native-plaid-link-sdk.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ Pod::Spec.new do |s|
end

s.dependency 'React-Core'
s.dependency 'Plaid', '~> 6.0.0-beta5'
s.dependency 'Plaid', '~> 6.0.0'
end

0 comments on commit efea459

Please sign in to comment.