18 lines
462 B
JavaScript
18 lines
462 B
JavaScript
|
|
||
|
let count = pureComponentFactory(
|
||
|
"count-ele",
|
||
|
({count}) => {
|
||
|
console.log("RENDERING COUNT: ", count);
|
||
|
return `<div> <label> count: ${count}</label></div>`
|
||
|
}
|
||
|
);
|
||
|
|
||
|
var buttonPress = function() {
|
||
|
let count = document.querySelector("#count");
|
||
|
let oldValue = parseInt(count.getAttribute('count'))
|
||
|
let newValue = oldValue + 1;
|
||
|
console.log(`OldValue: ${oldValue} NewValue: ${newValue}`);
|
||
|
count.setAttribute('count', newValue.toString());
|
||
|
};
|
||
|
|