( https://docs.amplify.aws/react-native/s ... ted/setup/)
Я установил API для хранилища GraphQL (который генерирует машинописный текст) и аутентификацию.
Package.json
Код: Выделить всё
{
"name": "gimme-golf",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"@aws-amplify/react-native": "^1.0.28",
"@aws-amplify/ui-react-native": "^2.1.6",
"@react-native-async-storage/async-storage": "^1.23.1",
"@react-native-community/netinfo": "^11.3.1",
"@types/react": "~18.2.45",
"aws-amplify": "^6.2.0",
"babel-plugin-module-resolver": "^5.0.2",
"expo": "~50.0.17",
"expo-status-bar": "~1.11.1",
"react": "18.2.0",
"react-native": "0.73.6",
"react-native-get-random-values": "^1.11.0",
"react-native-safe-area-context": "4.8.2",
"typescript": "^5.3.0"
},
"devDependencies": {
"@babel/core": "^7.20.0"
},
"private": true
}
Код: Выделить всё
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
import {
withAuthenticator,
useAuthenticator
} from '@aws-amplify/ui-react-native';
import { Amplify } from 'aws-amplify';
import amplifyconfig from './src/amplifyconfiguration.json';
Amplify.configure(amplifyconfig);
// retrieves only the current value of 'user' from 'useAuthenticator'
const userSelector = (context) => [context.user];
const SignOutButton = () => {
const { user, signOut } = useAuthenticator(userSelector);
return (
Hello, {user.username}! Click here to sign out!
);
};
const App = () => {
return (
);
}
export default withAuthenticator(App);
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Что бы я ни пытался, я всегда получаю вариация
Код: Выделить всё
iOS Bundling failed 4396ms (node_modules/expo/AppEntry.js)
Unable to resolve "@babel/runtime/helpers/classCallCheck" from "node_modules/react-native/Libraries/Components/Button.js"
Подробнее здесь: https://stackoverflow.com/questions/784 ... ve-ios-app
Мобильная версия