Skip to content

Commit c0f84a4

Browse files
author
nyqykk
committed
chore: revert change
1 parent a16c82e commit c0f84a4

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

examples/mf-example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "mf-example",
2+
"name": "@example/mf",
33
"scripts": {
44
"mf:dev": "pnpm --filter mf-host dev & pnpm --filter mf-remote dev & pnpm --filter react-component run serve"
55
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# @examples/react-component
2+
3+
This example demonstrates how to use Rslib to build a simple React component.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import styles from './index.module.scss';
2+
interface CounterButtonProps {
3+
onClick: () => void;
4+
label: string;
5+
}
6+
7+
export const CounterButton: React.FC<CounterButtonProps> = ({
8+
onClick,
9+
label,
10+
}) => (
11+
<button type="button" className={styles.button} onClick={onClick}>
12+
{label}
13+
</button>
14+
);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { CounterButton } from './components/CounterButton/index';
2+
import { useCounter } from './useCounter';
3+
import './index.scss';
4+
5+
export const Counter: React.FC = () => {
6+
const { count, increment, decrement } = useCounter();
7+
8+
return (
9+
<div>
10+
<h2 className="counter-text">Counter: {count}</h2>
11+
<CounterButton onClick={decrement} label="-" />
12+
<CounterButton onClick={increment} label="+" />
13+
</div>
14+
);
15+
};

0 commit comments

Comments
 (0)