Skip to content

Instantly share code, notes, and snippets.

{
"type": "div",
"style": {
"height": 300,
"fontSize": 14,
"fontWeight": "bold",
"textAlign": "center"
},
"children": [
{
function resolveStyles(component) {
// Restrict it from displaying in a smaller size
if (component.style.height < 300) {
component.style['height'] = 300
}
if (component.type === 'button') {
// Give all button components a dashed teal border
component.style['border'] = '1px dashed teal'
}
function start(component) {
// Restrict it from displaying in a smaller size
if (component.style.height < 300) {
component.style['height'] = 300
}
if (component.type === 'button') {
// Give all button components a dashed teal border
component.style['border'] = '1px dashed teal'
}
{
"type": "div",
"style": {
"height": 300,
"fontSize": 14,
"fontWeight": "bold",
"textAlign": "center"
},
"children": [
{
{
"type": "div",
"style": {
"height": 300,
"fontSize": 14,
"fontWeight": "bold",
"textAlign": "center"
}
}
function start(component) {
// Restrict it from displaying in a smaller size
if (component.style.height < 300) {
component.style['height'] = 300
}
if (component.type === 'button') {
// Give all button components a dashed teal border
component.style['border'] = '1px dashed teal'
}
const component = {
type: 'label',
style: {
height: 250,
fontSize: 14,
fontWeight: 'bold',
textAlign: 'center',
},
}
function getDate(callback) {
return callback(new Date())
}
function start(callback) {
return getDate(callback)
}
start(function (date) {
console.log(`Todays date: ${date}`)
function onChange(e, { ref }) {
console.log(`current state value: ${value}`)
console.log(`incoming value: ${e.target.value}`)
setValue(e.target.value)
console.log(`current state value now: ${value}`)
}
function App() {
const [value, setValue] = React.useState('')
function onChange(e, { ref }) {
console.log(`current state value: ${value}`)
console.log(`incoming value: ${e.target.value}`)
setValue(e.target.value)
console.log(`current state value now: ${value}`)
}