Skip to content

Commit

Permalink
Fix checks
Browse files Browse the repository at this point in the history
  • Loading branch information
anddriex committed Jan 27, 2025
1 parent 6f982a8 commit 369929f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 21 deletions.
6 changes: 3 additions & 3 deletions example/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
* @type {import('@babel/core').TransformOptions}
*/
module.exports = {
presets: ["@rnx-kit/babel-preset-metro-react-native"],
// added reanimated plugin
// https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started#step-2-add-reanimateds-babel-plugin
plugins: [
// '@babel/plugin-proposal-export-namespace-from', // -> for web support
'react-native-reanimated/plugin',
]
"react-native-reanimated/plugin",
],
presets: ["@rnx-kit/babel-preset-metro-react-native"],
};
6 changes: 3 additions & 3 deletions example/metro.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { makeMetroConfig } = require("@rnx-kit/metro-config");
const MetroSymlinksResolver = require("@rnx-kit/metro-resolver-symlinks");
const {
wrapWithReanimatedMetroConfig,
} = require('react-native-reanimated/metro-config');
} = require("react-native-reanimated/metro-config");

/**
* Metro configuration
Expand All @@ -17,8 +17,8 @@ const config = makeMetroConfig({
},
});

// maybe needs to wrap metro config with reanimated wrapper
// may need to wrap metro config with reanimated wrapper
// https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started#step-3-wrap-metro-config-with-reanimated-wrapper-recommended
module.exports = wrapWithReanimatedMetroConfig(
mergeConfig(getDefaultConfig(__dirname), config)
mergeConfig(getDefaultConfig(__dirname), config),
);
26 changes: 11 additions & 15 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import dedent from "dedent";
import React, { ReactElement, useCallback, useMemo, useRef } from "react";
import { Alert, Animated as VanillaAnimated, Button, Dimensions, SafeAreaView, Text } from "react-native";
import {
AttachStep,
SpotlightTourProvider,
StopParams,
TourBox,
TourStep,
} from "react-native-spotlight-tour";
import { Alert, Button, Dimensions, SafeAreaView, Text, Animated as VanillaAnimated } from "react-native";
import { Text as TextPaper } from "react-native-paper";
import Animated, { useSharedValue, withSpring } from "react-native-reanimated";
import { AttachStep, SpotlightTourProvider, StopParams, TourBox, TourStep } from "react-native-spotlight-tour";

import {
BoldText,
Expand All @@ -18,8 +14,6 @@ import {
TitleText,
} from "./App.styles";
import { DocsTooltip } from "./DocsTooltip";
import { Text as TextPaper } from 'react-native-paper';
import Animated, { useSharedValue, withSpring } from "react-native-reanimated";

export function App(): ReactElement {
const gap = useRef(new VanillaAnimated.Value(0)).current;
Expand Down Expand Up @@ -108,8 +102,8 @@ export function App(): ReactElement {
}, {
before() {
return new Promise<void>(resolve => {
reanimatedGap.value = withSpring(Dimensions.get("screen").height * 0.24)
return resolve()
reanimatedGap.value = withSpring(Dimensions.get("screen").height * 0.24);
return resolve();
});
},
render: ({ previous, stop }) => (
Expand Down Expand Up @@ -191,15 +185,17 @@ export function App(): ReactElement {
</DescriptionText>
</SectionContainerView>
</VanillaAnimated.View>
<Animated.View style={[{transform: [{translateY: reanimatedGap}]}]}>
<Animated.View style={[{ transform: [{ translateY: reanimatedGap }] }]}>
<SectionContainerView>
<AttachStep index={4}>
<TextPaper variant="titleMedium">{"Use it with your favorite libraries!"}</TextPaper>
<TextPaper variant="titleMedium">
{"Use it with your favorite libraries!"}
</TextPaper>
</AttachStep>
<DescriptionText>
{"It supports other animation and design libraries"}
</DescriptionText>
</SectionContainerView>
</SectionContainerView>
</Animated.View>
</>
)}
Expand Down

0 comments on commit 369929f

Please sign in to comment.