react
React Native 컴포넌트에서 children 스타일 덮어쓰는 방법
export const CustomButton: FC = ({ children, ...props }) => { const childStyle = {color: '#fff'}; const childrenWithProps = React.Children.map(children, (child) => { const childProps = { ...child.props, style: StyleSheet.flatten([childStyle, child.props.style]), }; if (React.isValidElement(child)) { return React.cloneElement(child, childProps); } return child; }); return ( {childrenWithProps} );..
[React] ApolloClient 캐시 비우는 간단한 방법
client.cache.evict({ id: "ROOT_QUERY", fieldName: "posts" })
[Strapi + React] ApolloClient로 초간단 pagination 구현하기
Strapi는 기본적으로 GraphQL을 지원한다. Strapi - Open source Node.js Headless CMS 🚀 Strapi is the next-gen headless CMS, open-source, javascript, enabling content-rich experiences to be created, managed and exposed to any digital device. strapi.io React의 ApolloClient를 활용하여 API를 연동하고 있었기 때문에, pagniation도 내장기능을 사용하려 했다. 찾아보니 offset과 limit를 활용한 `offsetLimitPagination`이라는 헬퍼가 있었고, 적용해봤는데 생각대로 잘 되지 않았다... www.a..