Ross Wollman 0c9e0d22df
fix(ct): preserve context changes (#13986)
1. add test (and fix) using context fixture with mount
2. add test for innerText that was failing prior to https://github.com/microsoft/playwright/pull/14008
2022-05-10 11:45:47 -07:00

10 lines
284 B
TypeScript

import React, { useEffect, useState } from 'react';
export const Fetch: React.FC<{ url: string }> = ({ url }) => {
const [data, setData] = useState('no response yet');
useEffect(() => {
fetch(url).then(res => res.text()).then(setData);
}, [url]);
return <p>{data}</p>;
}