Skip to content

Commit

Permalink
s
Browse files Browse the repository at this point in the history
  • Loading branch information
koma0504 committed Jun 18, 2021
1 parent c1e2c9b commit 6bb30a5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
3 changes: 2 additions & 1 deletion components/SwiperComp/SwiperComp.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import SwiperCore, { Autoplay, Pagination, Navigation } from "swiper/core";
// install Swiper modules
SwiperCore.use([Autoplay, Pagination, Navigation]);

export function SwiperComp() {
export function SwiperComp(slide) {
console.log("slide", slide);
return (
<>
<Swiper
Expand Down
35 changes: 23 additions & 12 deletions pages/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,39 @@ import { useEffect } from "react";
import { useState } from "react";

export default function Home({ blog }) {
console.log("blog", blog);
// useEffect(() => {
// console.log("マウント時");
// return () => {
// console.log("アンマウント時");
// };
// }, [count]);

const [count, setCount] = useState(1);
const hendleClick = useCallback(() => {
console.log(count);
if (count < 10) {
setCount((count) => count + 1);
}
}, [count]);
}, []);

useEffect(() => {
console.log("マウント時");
return () => {
console.log("アンマウント時");
};
}, [count]);
const [array, setArray] = useState([1, 2, 3]);
const handleAdd = useCallback(() => {
setArray((prevArray) => {
return prevArray;
});
}, []);
return (
<div className="body">
<Header title="RATIO OBSERVER" layout="swiper" />
<main className="main">
<h1>{count}</h1>
<botton href="/about" onClick={hendleClick}>
btn
</botton>
<botton onClick={hendleClick}>カウント</botton>
<ul>
{array.map((arrayele) => {
return <li key={arrayele}>{arrayele}</li>;
})}
</ul>
<botton onClick={handleAdd}>増えるよ</botton>

<section className="about">
<h2 className="title">ABOUT</h2>
Expand All @@ -43,7 +54,7 @@ export default function Home({ blog }) {
<ul className="portfolio_list">
{blog.map((blog) => (
<li key={blog.title} className="">
<Link href={`portfolio/${blog.title}`}>
<Link href={`/portfolio/${blog.title}`}>
<a>
<p className="">{blog.title}</p>
{<Image src={blog.thumbnail.url} width={300} height={200} />}
Expand Down

1 comment on commit 6bb30a5

@vercel
Copy link

@vercel vercel bot commented on 6bb30a5 Jun 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.