Set draftObject on componentDidMount (old initialDraft method)
@@ -41,16 +41,6 @@ import { actionCreators } from "../actions/actions";
this.props.fetchUnloadedAtom(this.props.fromAtomUri);
}
}
-
- //was called when showCreateInput was true
- loadInitialDraft() {
- if (this.props.showCreateInput && this.props.useCase.draft) {
- // deep clone of draft
- this.setState({
- draftObject: JSON.parse(JSON.stringify(this.props.useCase.draft)),
- });
- }
- }
*/
const mapStateToProps = state => {
@@ -218,6 +208,15 @@ class CreateAtom extends React.Component {
};
}
+ componentDidMount() {
+ if (this.props.showCreateInput && this.props.useCase.draft) {
+ // deep clone of draft
+ this.setState({
+ draftObject: JSON.parse(JSON.stringify(this.props.useCase.draft)),
+ });
+ }
+ }
+
render() {
if (!this.props.useCase) {
console.debug("no usecase specified, return empty div");
