- 前端(使用React Native)haoqian168.com
React Native允许你使用JavaScript和React来编写原生移动应用(iOS和Android)。
示例:简单的React Native App界面
jsx
// App.js
import React from ‘react’;
import { View, Text, Button } from ‘react-native’;
const App = () => {
return (
<View style={
{flex: 1, justifyContent: ‘center’, alignItems: ‘center’}}>
<Button
title=“Press Me”
onPress={() => alert(‘You pressed the button!’)}
/>
);
};
export default App;
2. 后端(使用Node.js + Express)
Node.js是一个基于Chrome V8引擎的JavaScript运行环境,而Express是一个灵活的Node.js web应用框架。
示例:简单的Express服务器
javascript
// app.js
const