We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I am working on a task in which i have to update the data from outside the timeline
when this editor data is changed outside then it shows error Invalid offset NaN specified
const editorData = useMemo(() => updatedTracks(timeline.data), [timeline.data]);
import { useMemo } from 'react'; import { Timeline } from '@xzdarcy/react-timeline-editor'; import { TimelineControls } from './TimelineControls/TimelineControls'; import { startLeft, useTimeLine } from '../TimelineContext/TimelineContext'; import { updatedTracks } from './fields'; import { AudioRender } from './CustomElements/AudioRender'; import { VideoRender } from './CustomElements/RenderVideo'; import './Timeline.less'; const TimelineComponent = () => { const { timelineRef, selectedSegment, scaleWidth, ...timeline } = useTimeLine(); const editorData = useMemo(() => updatedTracks(timeline.data), [timeline.data]); const mockEffect = { effect0: { id: 'effect0', name: '效果0', }, }; return ( <div style={{ height: '150px', position: 'relative', width: '100%' }}> <TimelineControls /> <Timeline ref={timelineRef as any} editorData={editorData} autoScroll={true} effects={mockEffect} onChange={() => {}} onClickAction={(ev, a) => timeline.setSelectedSegment(a.action)} scaleSplitCount={10} scaleWidth={scaleWidth} startLeft={startLeft} getActionRender={(action, row) => { if (row.id === '1') { return <VideoRender action={action} row={row} />; } if (row.id === '2') { return <AudioRender action={action} row={row} />; } }} style={{ width: '100%' }} /> </div> ); }; export default TimelineComponent;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I am working on a task in which i have to update the data from outside the timeline
when this editor data is changed outside then it shows error Invalid offset NaN specified
const editorData = useMemo(() => updatedTracks(timeline.data), [timeline.data]);
The text was updated successfully, but these errors were encountered: