https://github.com/pwcong/react-expressions-baidu
A React Component about Baidu Expressions.
https://github.com/pwcong/react-expressions-baidu
baidu-expressions react
Last synced: about 1 month ago
JSON representation
A React Component about Baidu Expressions.
- Host: GitHub
- URL: https://github.com/pwcong/react-expressions-baidu
- Owner: pwcong
- Created: 2017-02-18T15:54:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-30T03:37:54.000Z (about 7 years ago)
- Last Synced: 2025-03-24T17:21:21.931Z (2 months ago)
- Topics: baidu-expressions, react
- Language: JavaScript
- Homepage:
- Size: 589 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# react-expressions-baidu
A React Component about Baidu Expressions.## Install
```
npm install --save react-expressions-baidu
```## Usage
```
import {
BaiduExpressionsPicker,
isSymbol,
convertSymbol
} from 'react-expressions-baidu';...
handleAddSymbol(symbol){
// check input valid
if(isSymbol(symbol))
this.setState({
symbols: [...symbols, symbol]
});}
render(){
...
{
this.state.symbols.map(symbol => convertSymbol(symbol))
}
}
```
## API
* BaiduExpressionsPicker [ react component ]
props:
* pickerClass [ string ]
* symbolClass [ string ]
* onSymbolClick [ func ]* isSymbol [ func | str[string] -> bool ]
check if `str` is a valid symbol.
* convertSymbol [ func | symbol[string], key[string(option)] -> ReactDOM Node ]