Skip to content

Commit

Permalink
docs(cn): improve learn/synchronizing-with-effects translation (#1564)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwgood authored Jun 28, 2024
1 parent 0ab99bf commit 42dfc3b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/content/learn/synchronizing-with-effects.md
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export default function App() {
<>
<input value={text} onChange={e => setText(e.target.value)} />
<button onClick={() => setIsPlaying(!isPlaying)}>
{isPlaying ? 'Pause' : 'Play'}
{isPlaying ? '暂停' : '播放'}
</button>
<VideoPlayer
isPlaying={isPlaying}
Expand Down Expand Up @@ -361,10 +361,10 @@ function VideoPlayer({ src, isPlaying }) {

useEffect(() => {
if (isPlaying) {
console.log('Calling video.play()');
console.log('调用 video.play()');
ref.current.play();
} else {
console.log('Calling video.pause()');
console.log('调用 video.pause()');
ref.current.pause();
}
}, [isPlaying]);
Expand All @@ -379,7 +379,7 @@ export default function App() {
<>
<input value={text} onChange={e => setText(e.target.value)} />
<button onClick={() => setIsPlaying(!isPlaying)}>
{isPlaying ? 'Pause' : 'Play'}
{isPlaying ? '暂停' : '播放'}
</button>
<VideoPlayer
isPlaying={isPlaying}
Expand Down

0 comments on commit 42dfc3b

Please sign in to comment.