我正在使用 Tailwind (react/next) 并努力改变我的滚动条的外观。
这是一个单页应用程序,我一直在尝试创建自定义 CSS 以应用于索引文件中的第一个 div,如下所示:
<div className="no-scroll"> <<<<<<<--------- Adding custom css here
<Head>
<title>Oscar Ekstrand</title>
<link rel="icon" href="/images/favicon.ico" />
</Head>
<main className="flex flex-col no-scroll">
<section ref={heroref}>
<Hero scrollToContacts={scrollToContacts} />
</section>
<section ref={offeringref}>
<Offering />
</section>
<section ref={processref}>
<WhatIDo />
</section>
<section ref={biographyref}>
<CvBar />
</section>
<section ref={skillsetref}>
<Skillset />
</section>
</main>
<section ref={contactsref}>
<Footer />
</section>
</div>
Run Code Online (Sandbox Code Playgroud)
我可以使用自定义 CSS 类来处理按钮等内容,既具有“插件方法”又具有全局样式表。(https://play.tailwindcss.com/zQftpiBCmf)
但我不明白如何改变滚动条的外观。
有人有主意吗?
我遇到一个问题,我的 useEffect 导致出现以下警告:
无法对已卸载的组件执行 React 状态更新。这是一个空操作,但它表明应用程序中存在内存泄漏。要修复此问题,请取消 useEffect 清理函数中的所有订阅和异步任务。
仅当从该组件处于活动状态的页面开始重新加载页面时,该问题才会出现。
该组件运行良好,但警告看起来很糟糕。
我看过很多帖子,其中使用清理功能应该有效,并尝试应用,但它一直给我同样的警告。
有什么线索吗?
import React, { useState, useEffect } from 'react'
import ImageGallery from 'react-image-gallery';
import "./ImageGal.css"
import "react-image-gallery/styles/css/image-gallery.css";
import fire from "./firebase";
function ImageGal({ unique }) {
const [images, setImages] = useState([]);
useEffect(() => {
const fetchImages = async () => {
const response = fire.firestore().collection("albums/" + unique + "/images"); //unique is the name of the album, passed on as a prop to this component
const data = await response.get(); …Run Code Online (Sandbox Code Playgroud)