Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const STARTING_CODE = {
code: `type ButtonPropType = {
/* This is*/
label: string
}
class Button extends React.Component{
}`,
typeSystem: 'flow'
};
class App extends Component {
state = {
code: STARTING_CODE.code,
dataForPropTypes: ert(STARTING_CODE.code, STARTING_CODE.typeSystem),
typeSystem: STARTING_CODE.typeSystem,
error: null
};
updateCode = code => {
console.log(compress(code));
try {
const ast = ert(code, this.state.typeSystem);
this.setState({
dataForPropTypes: ast,
error: null
});
} catch (error) {
this.setState({
error
});
code: `type ButtonPropType = {
/* Handler to be called on click of the button*/
onClick: () => void
}
class Button extends React.Component{
}`,
typeSystem: 'flow'
};
class App extends Component {
state = {
code:
uriUtils.parseQuery().code_lz !== undefined
? uriUtils.decompress(uriUtils.parseQuery().code_lz)
: STARTING_CODE.code,
dataForPropTypes: ert(STARTING_CODE.code, STARTING_CODE.typeSystem),
typeSystem: STARTING_CODE.typeSystem,
error: null
};
updateCode = code => {
try {
const ast = ert(code, this.state.typeSystem);
this.setState({
dataForPropTypes: ast,
error: null
});
uriUtils.updateQuery({ code: uriUtils.compress(code) });
} catch (error) {
this.setState({
error
});
updateCode = code => {
console.log(compress(code));
try {
const ast = ert(code, this.state.typeSystem);
this.setState({
dataForPropTypes: ast,
error: null
});
} catch (error) {
this.setState({
error
});
window.error = error;
}
};
updateCode = code => {
try {
const ast = ert(code, this.state.typeSystem);
this.setState({
dataForPropTypes: ast,
error: null
});
uriUtils.updateQuery({ code: uriUtils.compress(code) });
} catch (error) {
this.setState({
error
});
window.error = error;
}
};