Example View
Installation
NPM
$ npm i react-simple-comment
Usage
import {BasicComment,BaseReply, replyInterface} from 'react-simple-comment' function App() { const [data] = React.useState([{ id : 1, name : 'jun', text : 'test', date : new Date(), likeCount : 0, dislikeCount : 2 }, { id : 2, name : 'jun', text : 'test', date : new Date(), likeCount : 10 }] as replyInterface[]) return ( <div> <span>๋๊ธ {data.length}๊ฐ</span> <BasicComment placeholder="๋๊ธ์ ์ ๋ ฅํด์ฃผ์ธ์..." onSend={(text)=>{ console.log('current text',text) }} /> <div> {data.map((data) => <BaseReply onLike={(commentId)=>{ console.log('onLike',commentId) }} onDislike={(commentId)=>{ console.log('onDisLike',commentId) }} onReplySend={(commentId,text)=>{ console.log('onReplySend',commentId,text) }} {...data} /> ) } </div> </div> ); } export default App;
ย
Props
โฆ
๋๊ธฐ
nextjs๋ก notion๋ธ๋ก๊ทธํ ์งํ์ค ๋๊ธ๊ธฐ๋ฅ์ด ํ์ํ๋ฐ ๊ฐ๋จํ ๋๊ธ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์์๊ณ ํ๋ ๋ง๋ค์ด๋๋ฉด ๋ค์ ์งํ ํ๋ก์ ํธ์๋ ์ฌ์ฌ์ฉ์ด ๊ฐ๋ฅํ ๊ฒ ๊ฐ๋ค๊ณ ์๊ฐํด์ ์์ํ๋ค
๊ธฐ๋ฅ
v1.0.1
- ๋๊ธ์ ๋ ฅ ๊ธฐ๋ฅ
- ์ ์ก ๊ธฐ๋ฅ
to be added
- ๋๊ธ์ ๋ ฌ ๊ธฐ๋ฅ
- ๋๊ธ๊ฒ์ ๊ธฐ๋ฅ
ย
๊ฐ๋ฐํ๊ฒฝ
- nodejs 19.0.3