Next JS
To use react-raster with NextJS you need to take some following steps:
Setup Styled-Components#
To use it alongside styled-components you might need to:
1. Install babel-plugin-styled-components#
2. Create babel-config.json file in your root-directory#
3. Add _document.jsx to your pages-directory#
Combine Box with Link#
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!