Submission notice now updates when sponsors are added

This commit is contained in:
Ajay Ramachandran
2020-04-02 00:59:11 -04:00
parent 72c98923f6
commit e055a66342
3 changed files with 17 additions and 4 deletions

View File

@@ -9,7 +9,11 @@ class SubmissionNotice {
callback: () => any;
noticeRef: React.MutableRefObject<SubmissionNoticeComponent>;
constructor(contentContainer: () => any, callback: () => any) {
this.noticeRef = React.createRef();
this.contentContainer = contentContainer;
this.callback = callback;
@@ -38,10 +42,15 @@ class SubmissionNotice {
ReactDOM.render(
<SubmissionNoticeComponent
contentContainer={contentContainer}
callback={callback} />,
callback={callback}
ref={this.noticeRef} />,
noticeElement
);
}
update() {
this.noticeRef.current.forceUpdate();
}
}
export default SubmissionNotice;