Next JS
To use react-raster
with NextJS
you need to take some following steps:
#
Setup Styled-ComponentsTo use it alongside styled-components
you might need to:
babel-plugin-styled-components
#
1. Install babel-config.json
file in your root
-directory#
2. Create _document.jsx
to your pages
-directory#
3. Add Box
with Link
#
Combine The best way to combine links in NextJS with react-raster is to set the passHref
-prop on your Link
-Component. This will automatically infuse a href
- and onClick
-prop to its wrapped Box
, which also needs to have set tag="a"
, to be an anchor
-tag. So there is no need for an extra anchor-tag, which might complicate your data-structure!