const OrderComplete = ({
stage
}) =>
const someFunction = () => { console.log(stage) }
useEffect(()=> setTimeout(()=>someFunction(),1000),[])
...
我正在获得阶段不确定的价值。但是,如果我使用react dev工具并查看像这样的组件道具
组件中的值
答案 0 :(得分:1)
您应该使用from tkinter import *
from moviepy.editor import *
window = Tk()
e = Entry(window, width=50)
e.pack()
def myClick():
myLabel = Label(window, text="Converting the file named : " + e.get())
myLabel.pack()
myButton = Button(window, text="Convert", command=myClick)
video = e.get()
myButton.pack()
mp4_file = video
mp3_file = "{}.mp3".format(mp4_file)
videoClip = VideoFileClip(mp4_file)
audioclip = videoClip.audio
audioclip.write_audiofile(mp3_file)
audioclip.close()
videoClip.close()
window.mainloop()
的依赖项数组:
useEffect
因为如果传递一个空数组,则回调将仅在const OrderComplete = ({
stage
}) =>
const someFunction = () => { console.log(stage) }
useEffect(()=> setTimeout(()=>someFunction(),1000),[someFunction])
道具可能为stage
的情况下才在初始渲染时生效