Below is my code snippet:
import React, { useState } from "react";
import Unsplash, { toJson } from "unsplash-js";
const unsplash = new Unsplash({
accessKey: "****",
secret:"****"
});
export default function SearchPhotos() {
const [query, setQuery] = useState("");
console.log(query);
const searchPhotos = async (e) => {
e.preventDefault();
unsplash.search
.photos(query)
.then(toJson)
.then((json) => {
console.log(json);
});
console.log("Submitting the Form")
};
I m getting this error in React Application Attempted import error: 'unsplash-js' does not contain a default export (imported as 'Unsplash'). I have checked in helper function but didn't still facing the import error for Unsplash and toJson.