React_Native_Tutorial/js/components/Quote.js
marcusferl@web.de 57976bcd72 update
2021-12-29 14:06:22 +01:00

17 lines
594 B
JavaScript

import React, { Component, Fragment } from 'react';
import { Text } from 'react-native'
export default class Quote extends Component {
render() {
const { text, author } = this.props // destructuring
return (
<Fragment>
<Text style={styleText}>{text}</Text>
<Text style={styleAuthor}>&mdash; {author}</Text>
</Fragment>);
}
}
// Styling in React Native mit JavaScript
const styleText = { fontSize: 25, fontWeight: 'bold', color: 'black' };
const styleAuthor = { fontSize: 17, fontsStyle: 'italic', color: 'red' };