Skip to content

Commit

Permalink
Remove duplicate nullness check on answerableCallback
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremywiebe committed Dec 4, 2024
1 parent d052726 commit 84a1b2f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/perseus/src/server-item-renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,11 @@ export class ServerItemRenderer
}

componentDidUpdate(prevProps: Props, prevState: State) {
if (this.props.apiOptions.answerableCallback) {
const answerableCallback = this.props.apiOptions.answerableCallback;
if (answerableCallback != null) {
const isAnswerable =
this.questionRenderer.emptyWidgets().length === 0;
const {answerableCallback} = this.props.apiOptions;
if (answerableCallback) {
answerableCallback(isAnswerable);
}
answerableCallback(isAnswerable);
}

if (!this._fullyRendered) {
Expand Down

0 comments on commit 84a1b2f

Please sign in to comment.