Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. import React from "react";
  2.  
  3. class Info extends React.Component {
  4. state = {
  5. kurczak: "kurczak"
  6. };
  7.  
  8. handleMenuName = () => {
  9. if (document.URL.indexOf("info") > -1) {
  10. this.setState({ kurczak: "NowyKurczak" });
  11. const url = "jestem url info";
  12. }
  13. };
  14.  
  15. componentDidMount() {
  16. this.handleMenuName();
  17. }
  18.  
  19. testowaDana = "testowaDana";
  20. render() {
  21. document.onload = this.handleMenuName;
  22.  
  23. return (
  24. <>
  25. <h1>
  26. Komponent z Info {this.state.kurczak} {this.testowaDana}{" "}
  27. </h1>
  28. 1>
  29. <h1>{this.url}</h1>
  30. </>
  31. );
  32. }
  33. }
  34.  
  35. export default Info;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement