Skip to content

Commit

Permalink
fix: update url when props.url changes
Browse files Browse the repository at this point in the history
  • Loading branch information
shanejonas committed Aug 19, 2019
1 parent 27cde35 commit 2e5c58d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/containers/Inspector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ const Inspector: React.FC<IProps> = (props) => {
const [url, setUrl] = useState(props.url || "");
const [client] = useClient(url);

useEffect(() => {
if (props.url) {
setUrl(props.url);
}
}, [props.url]);

const handlePlayButton = async () => {
if (client) {
incrementId();
Expand Down

0 comments on commit 2e5c58d

Please sign in to comment.