« first day (3703 days earlier)      last day (1252 days later) » 

1:08 AM
Happy Birthday JavaScript!
https://www.zdnet.com/article/javascript-at-25-the-programming-language-that-makes-the-world-go-round/
 
@Sheepy :D
 
 
3 hours later…
3:50 AM
hi everybody
 
@PurTahan Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
how to config creat-react-app to work on one .net page stackoverflow.com/q/65122036/1932159
 
 
2 hours later…
5:25 AM
https://chat.stackoverflow.com/transcript/message/51081524#51081524

@Minsky thanks a lot that was exactly what was happening, I didnt see that
 
ABC
HI
 
need some help with this one -> stackoverflow.com/questions/65148022/…
 
ABC
I have a question, cause I have a child component, when there's a change it doesn't recognize the variable
 
 
4 hours later…
10:07 AM
Hi, what does '.' is not recognized as an internal or external command,
operable program or batch file. mean?
 
 
1 hour later…
11:20 AM
That doesn't look like a JS error.
 
 
2 hours later…
1:37 PM
Hey , anyone know how notification logic works? i want put a badge shows how many unread messages user have and destroy it when user hit messsages route
 
 
1 hour later…
3:05 PM
Hy
 
@pingPong Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
user12582392
3:29 PM
@jeea you're welcome!!
 
Hello everyone
I don't have too much experience with ReactJS, but I am learning
Now I have one situation where I am not sure how to continue
I have InfoBox Component, which should be shared component
Code:
import React from 'react';
import styles from './InfoBox.module.css';

const InfoBox = ({ info }) => {
  return (
    <div className={styles.locationInfo}>
      <h2>Event Location Info</h2>
      <ul className={styles.locationList}>
        <li>
          <label>Id:</label>
          <span>{info.id}</span>
        </li>
        <li>
          <label>Title:</label>
          <span>{info.title}</span>
        </li>
        <li>
          <label>Latitude:</label>
          <span>{info.lat}</span>
What's the issue ? This InfoBox open when I click on Marker
const Map = ({ events, center, zoom }) => {
  const [locationInfo, setLocationInfo] = useState();

  const markers = events.map((ev) => {
    const markerClickHandler = () => {
      setLocationInfo({
        id: ev.id,
        title: ev.title,
        lat: ev.geometry[0].coordinates[1],
        lng: ev.geometry[0].coordinates[0]
      });
    };

    return (
      <Marker
        lat={ev.geometry[0].coordinates[1]}
        lng={ev.geometry[0].coordinates[0]}
        key={ev.id}
        clicked={markerClickHandler}
I want to open the same InfoBox but with simple message: 'No data available for selected category`
if event.length === 0
or if you have any other suggestion feel free to tell
 
 
2 hours later…
5:41 PM
Why this solution does not work ?
  useEffect(() => {
    if (!selectedCategory.link) {
      return;
    }
    const url = selectedCategory.link;

    fetch(url)
      .then((response) => response.json())
      .then((data) => {
        if (data.events.length === 0) {
          return (
            <InfoBox>
              <h2>Nema podataka</h2>
            </InfoBox>
          );
        }
        setEventData(data.events);
      })
      .catch((err) => console.error(err));
  }, [selectedCategory]);
InfoBox Components looks like
const InfoBox = (props) => {
  return <div className={styles.locationInfo}>{props.children}</div>;
};
 
6:08 PM
the return makes no sense inside your fetch callback..
cchange the code where you use the eventData from setEventData and check for eventData.length === 0 there
 

« first day (3703 days earlier)      last day (1252 days later) »