Skip to content

Commit

Permalink
Remove imperative API from ItemEditor for preview updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremywiebe committed Jul 17, 2024
1 parent 19fe692 commit 520bf66
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/perseus-editor/src/item-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ import * as React from "react";
import _ from "underscore";

import DeviceFramer from "./components/device-framer";
import Editor from "./editor";
import IframeContentRenderer from "./iframe-content-renderer";
import ContentRenderer from "./content-renderer";
import Editor from "./editor";
import ItemExtrasEditor from "./item-extras-editor";

import type {
Expand Down Expand Up @@ -45,7 +44,6 @@ class ItemEditor extends React.Component<Props> {
answerArea: {},
};

frame = React.createRef<IframeContentRenderer>();
questionEditor = React.createRef<Editor>();
itemExtrasEditor = React.createRef<ItemExtrasEditor>();

Expand All @@ -56,10 +54,6 @@ class ItemEditor extends React.Component<Props> {
this.props.onChange(_(props).extend(newProps), cb, silent);
};

triggerPreviewUpdate: (newData?: any) => void = (newData: any) => {
this.frame.current?.sendNewData(newData);
};

handleEditorChange: ChangeHandler = (newProps, cb, silent) => {
const question = _.extend({}, this.props.question, newProps);
this.updateProps({question}, cb, silent);
Expand Down

0 comments on commit 520bf66

Please sign in to comment.