<text name="text1" id="text1">asxacasc</text>
<Button size="xl" level="2" onClick={tern()}>
ОТПРАВИТЬ ЗАЯВКУ
</Button>
</Panel>
);
function tern() {
try {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
var el = document.getElementById("text1");
el.firstChild.data = "Unlock";
}
else {
var el = document.getElementById("text1");
el.firstChild.data = "lock";
}
};
}
catch
{
}
xmlhttp.open("POST", "https://cvetyservervk.000webhostapp.com/test.php", true);
xmlhttp.send({ method: "proverka", addres: "asdasd" });
}
Persik.propTypes = {
id: PropTypes.string.isRequired,
go: PropTypes.func.isRequired,
};
export default Pro;
TypeError: Cannot read property 'firstChild' of null
Явно говорит о том, что у вас document.getElementById("text1") возвращает null. Это говорит о том, что на странице нет элемента с id равным text1.
Продвижение своими сайтами как стратегия роста и независимости