mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? fix: Fetch chunk list by @tanstack/react-query #1306 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
34 lines
750 B
TypeScript
34 lines
750 B
TypeScript
import { memo, useState } from 'react';
|
|
|
|
function compare(oldProps, newProps) {
|
|
return true;
|
|
}
|
|
|
|
const Greeting = memo(function Greeting({ name }) {
|
|
console.log('Greeting was rendered at', new Date().toLocaleTimeString());
|
|
return (
|
|
<h3>
|
|
Hello{name && ', '}
|
|
{name}!
|
|
</h3>
|
|
);
|
|
}, compare);
|
|
|
|
export default function MyApp() {
|
|
const [name, setName] = useState('');
|
|
const [address, setAddress] = useState('');
|
|
return (
|
|
<>
|
|
<label>
|
|
Name{': '}
|
|
<input value={name} onChange={(e) => setName(e.target.value)} />
|
|
</label>
|
|
<label>
|
|
Address{': '}
|
|
<input value={address} onChange={(e) => setAddress(e.target.value)} />
|
|
</label>
|
|
<Greeting name={name} />
|
|
</>
|
|
);
|
|
}
|