Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
notebook: ImmutableNotebook;
transforms: object;
theme: "light" | "dark";
}
interface State {
notebook: ImmutableNotebook;
}
export default class NotebookRender extends React.PureComponent {
static defaultProps = {
displayOrder: defaultDisplayOrder,
transforms: defaultTransforms,
notebook: appendCellToNotebook(
emptyNotebook,
createCodeCell().set("source", "# where's the content?")
),
theme: "light"
};
constructor(props: Props) {
super(props);
this.state = {
notebook: fromJS(props.notebook)
};
}
componentWillReceiveProps(nextProps: Props) {
if (nextProps.notebook !== this.props.notebook) {
this.setState({ notebook: fromJS(nextProps.notebook) });
}
notebook: any;
transforms: Transforms;
theme: "light" | "dark";
};
type State = {
notebook: any;
};
export class NotebookPreview extends React.PureComponent {
static defaultProps = {
displayOrder: defaultDisplayOrder,
transforms: defaultTransforms,
notebook: appendCellToNotebook(
emptyNotebook,
createCodeCell().set("source", "# where's the content?")
),
theme: "light"
};
constructor(props: Props) {
super(props);
this.state = {
notebook: fromJS(props.notebook)
};
}
componentWillReceiveProps(nextProps: Props) {
if (nextProps.notebook !== this.props.notebook) {
this.setState({ notebook: fromJS(nextProps.notebook) });
}
const Themes = {
dark: createGlobalStyle`
:root {
${themes.dark}
}`,
light: createGlobalStyle`
:root {
${themes.light}
}`
};
export class NotebookPreview extends React.PureComponent {
static defaultProps = {
notebook: appendCellToNotebook(
emptyNotebook,
createCodeCell().set("source", "# where's the content?")
),
theme: "light"
};
constructor(props: Props) {
super(props);
this.state = {
notebook: fromJS(props.notebook)
};
}
componentWillReceiveProps(nextProps: Props) {
if (nextProps.notebook !== this.props.notebook) {
this.setState({ notebook: fromJS(nextProps.notebook) });
}
const Themes = {
dark: createGlobalStyle`
:root {
${themes.dark}
}`,
light: createGlobalStyle`
:root {
${themes.light}
}`
};
export default class NotebookRender extends React.PureComponent {
static defaultProps = {
notebook: appendCellToNotebook(
emptyNotebook,
createCodeCell().set("source", "# where's the content?")
),
theme: "light"
};
constructor(props: Props) {
super(props);
this.state = {
notebook: fromJS(props.notebook)
};
}
componentWillReceiveProps(nextProps: Props) {
if (nextProps.notebook !== this.props.notebook) {
this.setState({ notebook: fromJS(nextProps.notebook) });
}