/
githubmirror
/
redux
Обзор
Документация
Войти
/
githubmirror
/
redux
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
examples/real-world/src/components/Repo.js
31 строка
681 B
Tim Dorr
Format the examples
20 мар 2024, 19:52
Не верифицирован
20 мар 2024, 19:52
3085048
Код
Авторство
О чём код?
import React from 'react' import PropTypes from 'prop-types' import { Link } from 'react-router-dom' const Repo = ({ repo, owner }) => { const { login } = owner const { name, description } = repo return ( <div className="Repo"> <h3> <Link to={`/${login}/${name}`}>{name}</Link> {' by '} <Link to={`/${login}`}>{login}</Link> </h3> {description && <p>{description}</p>} </div> ) } Repo.propTypes = { repo: PropTypes.shape({ name: PropTypes.string.isRequired, description: PropTypes.string }).isRequired, owner: PropTypes.shape({ login: PropTypes.string.isRequired }).isRequired } export default Repo