-
I am trying to fetch data in my NextJS project. I am using import { supabase } from "../lib/supabase";
function Displaydata({ data }) {
return (
<div>
{data.map((alldata) => {
<div key={alldata.id}>
{alldata.name}
</div>;
})}
</div>
);
}
export async function getStaticProps() {
const { data } = await supabase.from("test").select("*");
console.log(data);
return {
props: {
data: data,
},
};
}
export default Displaydata; |
Beta Was this translation helpful? Give feedback.
Answered by
gomflo
Apr 19, 2021
Replies: 1 comment 1 reply
-
try this (removing the second curly braces: {data.map((alldata) =>
<div key={alldata.id}>
{alldata.name}
</div>
)} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
indahud
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
try this (removing the second curly braces: