Skip to content

Commit

Permalink
remove text prop types, since its deprecated, bump version, revert ex…
Browse files Browse the repository at this point in the history
…ample
  • Loading branch information
fawaz-ahmed committed Jan 13, 2023
1 parent 0e8f0fa commit 7234080
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
14 changes: 1 addition & 13 deletions example/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,10 @@ import {SafeAreaView, StyleSheet, View} from 'react-native';
import ReadMore from './src';

const App = () => {
const [collapsed, setCollapsed] = useState(true);

const toggle = () => {
setCollapsed(!collapsed);
};

return (
<SafeAreaView style={styles.safe}>
<View style={styles.root}>
<ReadMore
numberOfLines={3}
style={styles.textStyle}
collapsed={collapsed}
onPress={toggle}
onSeeMore={() => setCollapsed(false)}
onSeeLess={() => setCollapsed(true)}>
<ReadMore numberOfLines={3} style={styles.textStyle}>
{
"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."
}
Expand Down
3 changes: 0 additions & 3 deletions example/src/ReadMore.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
LayoutAnimation,
Platform,
UIManager,
TextPropTypes,
} from 'react-native';
import {getTextByChildren, insertAt, linesToCharacters} from './helper';

Expand All @@ -17,7 +16,6 @@ const enableGlobalLayoutAnimation = enable => {
return;
}
globalAnimationEnabled = true;
console.log('enabling global animation');
if (Platform.OS === 'android') {
if (UIManager.setLayoutAnimationEnabledExperimental) {
UIManager.setLayoutAnimationEnabledExperimental(true);
Expand Down Expand Up @@ -769,7 +767,6 @@ const styles = StyleSheet.create({
});

ReadMore.propTypes = {
...TextPropTypes,
seeMoreStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
seeLessStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
wrapperStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fawazahmed/react-native-read-more",
"version": "3.0.0",
"version": "3.0.1",
"description": "A simple react native library to show large blocks of text in a condensed manner with the ability to collapse and expand.",
"main": "dist/index.js",
"types": "index.d.ts",
Expand Down

0 comments on commit 7234080

Please sign in to comment.