Skip to content

Commit 2e5c58d

Browse files
committed
fix: update url when props.url changes
1 parent 27cde35 commit 2e5c58d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/containers/Inspector.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ const Inspector: React.FC<IProps> = (props) => {
6464
const [url, setUrl] = useState(props.url || "");
6565
const [client] = useClient(url);
6666

67+
useEffect(() => {
68+
if (props.url) {
69+
setUrl(props.url);
70+
}
71+
}, [props.url]);
72+
6773
const handlePlayButton = async () => {
6874
if (client) {
6975
incrementId();

0 commit comments

Comments
 (0)