Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
fixtureUnserializableProps: {},
fixtureUserInput: '{}',
isFixtureUserInputValid: true,
};
if (this.isFixtureSelected(props) && this.doesSelectedFixtureExist(props)) {
const originalFixtureContents = this.getSelectedFixtureContents(props);
// Unserializable props are stored separately from serializable ones
// because the serializable props can be overriden by the user using
// the editor, while the unserializable props are always attached
// behind the scenes
const {
unserializable,
serializable,
} = splitUnserializableParts(originalFixtureContents);
_.assign(state, {
fixtureContents: serializable,
fixtureUnserializableProps: unserializable,
fixtureUserInput: this.getStringifiedFixtureContents(serializable),
});
}
return state;
},
},
if (!hasInitialFixture({ component, fixture })) {
// Nothing is rendered until parent frame says so
return {
component: null,
fixture: {
unserializable: {},
serializable: {},
},
fixtureUpdateId: 0,
};
}
const {
unserializable,
serializable,
} = splitUnserializableParts(fixtures[component][fixture]);
return {
component,
fixture: {
unserializable,
serializable: fixtureBody || serializable,
},
// Used as React Element key to ensure loaded components are rebuilt on
// every fixture change (instead of reusing instance and going down the
// componentWillReceiveProps route)
fixtureUpdateId: getUpdateId(),
};
};