我正在尝试为具有默认样式的React-Native应用程序创建一些可重用的UI组件.
默认示例MyText(橙色,14,粗体):
import React, { Component, StyleSheet, Text } from 'react-native';
const styles = StyleSheet.create({text: {color: 'orange', fontSize: 14, fontWeight: 'bold'}});
export default class MyText extends Component {
render() {
return <Text style={styles.text}>{this.props.children}</Text>
}
}
Run Code Online (Sandbox Code Playgroud)
我想怎么用它:
import Text from '../ui/myText';
...
<Text style={{color: 'black'}}>My custom styled text, but in black instead of orange</Text>
...
Run Code Online (Sandbox Code Playgroud)
有没有办法做到这一点?显然,如果我尝试访问this.props.style它,只需返回已编译样式表的ID.
我正在开发的应用程序使用触发器在系统内发生某些操作时AFTER CREATE/UPDATE/DELETE创建通知。pg_notify目前,我们有一个小型 Node.JS 应用程序,LISTEN用于处理事件,然后立即将它们发布到 AWS SNS 主题,该主题将转发到我们的 SQS 事件队列。从该队列中,我们根据事件触发各种事件(电子邮件、短信、lambda、长时间运行的作业等)。
这种架构运行良好,但位于 PostgreSQL 实例和 SNS 主题之间的 Node.JS 应用程序似乎有点脆弱。我无法真正在两个可用区中运行两个副本,因为消息会重复。
我正在寻找一种更好的方法将这些 Postgres 通知导入 SQS。有什么选择吗?如果 Postgres Aurora 有什么东西,我们可能会考虑。