Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const CalcFib: React.FC<{ count: number }> = ({ count }) => {
const { result, error } = useWorker(createWorker, count);
if (error) return <div>Error: {error}</div>;
return <div>Result: {result}</div>;
};
const CalcFib: React.FC<{ count: number }> = ({ count }) => {
const { result, error } = useWorker('./slow_fib.js', count);
if (error) return <div>Error: {error}</div>;
return <div>Result: {result}</div>;
};
const CalcFib: React.FC<{ count: number }> = ({ count }) => {
const { result, error } = useWorker(createWorker, count);
if (error) return <div>Error: {error}</div>;
return <div>Result: {result}</div>;
};
const CalcFib = ({ count }) => {
const { result, error } = useWorker(createWorker, count);
if (error) return <div>Error: {error}</div>;
return <div>Result: {result}</div>;
};