Files
ragflow/web/src/pages/force-graph.tsx
balibabu 8468031e39 fix: Fetch chunk list by @tanstack/react-query #1306 (#1738)
### 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)
2024-07-29 19:20:13 +08:00

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} />
</>
);
}