I am creating my Portfolio and in the skills section I want to add a tooltip on the image for the name of the skill. following is my SkillCard.jsx and .css I am facing error as
Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app SkillCard.jsx
import React from 'react'; import './SkillsInfoCard.css'; const SkillsInfoCard = ({ heading, skills }) => { const renderSkillInfo = (item) => (
); const renderRows = () => { const rows = []; for (let i = 0; i < skills.length; i += 4) { const row = skills.slice(i, i + 4); rows.push( {row.map(renderSkillInfo)} ); } return rows; }; return ( {renderRows()} ) }; export default SkillsInfoCard;
Источник: https://stackoverflow.com/questions/780 ... p-in-react