Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ERROR] TypeError #162

Open
nagayev opened this issue Jan 1, 2021 · 1 comment
Open

[ERROR] TypeError #162

nagayev opened this issue Jan 1, 2021 · 1 comment

Comments

@nagayev
Copy link

nagayev commented Jan 1, 2021

TypeError: Cannot read property 'data-src' of undefined
at react-awesome-slider/dist/index.js:1:20395
My code:

const [projects, setProjects] = React.useState([]);
  React.useEffect(() => {
    fetch("p.json")
      .then((data) => data.json())
      .then((data) => setProjects(data))
      .catch((err) => console.error(err));
  }, []);
  ...
    <AwesomeSlider className="slider">
      {projects.map((v, i) => {
        <Project data={v} key={i} />;
      })}
      <div>
        <Tiles />
      </div>
    </AwesomeSlider>
@trolit
Copy link

trolit commented Jan 3, 2021

Make sure that you are binding each of your project video src to video src tag inside your Project component using props or however you prefer e.g.

export default function Project() {
  return (
    <div>
      <video
            style={{...}}
            controls
            src=  --> pathToVideo <--
          />
    </div>
  );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants