
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-comment-system
Advanced tools
A modern, customizable comment system component for React applications with TypeScript and Tailwind CSS support.
A modern, customizable comment system component for React applications with TypeScript and Tailwind CSS support.
# npm
npm install react-comment-system
# yarn
yarn add react-comment-system
# pnpm
pnpm add react-comment-system
This package requires the following peer dependencies:
{
"react": "^17.0.0 || ^18.0.0",
"react-dom": "^17.0.0 || ^18.0.0",
"tailwindcss": "^3.0.0"
}
import { CommentSystem } from "react-comment-system";
// Example initial comments
const initialComments = [
{
id: 1,
text: "Great post!",
author: "John Doe",
timestamp: new Date().toISOString(),
likes: 0,
replies: [],
},
];
function App() {
const handleCommentAdd = (comment) => {
console.log("New comment:", comment);
// Handle comment addition
};
const handleCommentDelete = (commentId) => {
console.log("Deleted comment:", commentId);
// Handle comment deletion
};
const handleCommentLike = (commentId) => {
console.log("Liked comment:", commentId);
// Handle like action
};
return (
<CommentSystem
initialComments={initialComments}
onCommentAdd={handleCommentAdd}
onCommentDelete={handleCommentDelete}
onCommentLike={handleCommentLike}
className="my-custom-class"
/>
);
}
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
initialComments | Comment[] | No | [] | Initial comments to display |
onCommentAdd | (comment: Comment) => void | No | - | Callback when a comment is added |
onCommentDelete | (commentId: number) => void | No | - | Callback when a comment is deleted |
onCommentLike | (commentId: number) => void | No | - | Callback when a comment is liked |
className | string | No | '' | Additional CSS classes |
interface Comment {
id: number;
text: string;
author: string;
timestamp: string;
likes: number;
replies: Comment[];
parentId?: number;
}
The component uses Tailwind CSS for styling. Make sure to include Tailwind CSS in your project:
// tailwind.config.js
module.exports = {
content: [
// ...
"./node_modules/react-comment-system/**/*.{js,ts,jsx,tsx}",
],
// ...
};
<CommentSystem initialComments={[]} />
<CommentSystem
initialComments={comments}
onCommentAdd={(comment) => {
saveCommentToDatabase(comment);
updateLocalState(comment);
}}
onCommentDelete={async (id) => {
await deleteCommentFromDatabase(id);
removeFromLocalState(id);
}}
/>
<CommentSystem
className="dark:bg-gray-800 dark:text-white"
initialComments={comments}
/>
# Install dependencies
npm install
# Build package
npm run build
# Run tests
npm test
# Run development server
npm run dev
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)MIT © [Your Name]
If you like this project, please give it a ⭐️ on GitHub! https://github.com/wowdevapp/react-comment-system
For issues and feature requests, please create an issue.
FAQs
A modern, customizable comment system component for React applications with TypeScript and Tailwind CSS support.
We found that react-comment-system demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.