0.2.1 • Published 3 years ago

react-native-usemarkdown-chat v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Demo

Installation

npm install react-native-usemarkdown-chat

Usage

import useMarkdown, { textToMarkdown } from 'react-native-usemarkdown-chat';

// ...

const [text, setText] = useMarkdown();

textToMarkdown function is not hook it is basically text to markdown converter. you can use this for making own custom useState.

Example Code

import * as React from 'react';

import { StyleSheet, View, TextInput } from 'react-native';
import useMarkdown from 'react-native-usemarkdown-chat';

export default function App() {
  const [text, setText] = useMarkdown();
  return (
    <View style={styles.container}>
      <TextInput style={styles.input} value={text} onChangeText={setText} />
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
  },
  input: {
    width: '100%',
    height: 100,
    backgroundColor: 'gray',
    fontSize: 30,
  },
});

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT