Closed kspacja closed 5 years ago
global setup is not implemented right now, PR are welcome.
But can be archive easily with your own React component, for Example. (Caution!!, not tested myself)
./my-scrollchor.jsx
import React, { Component } from "react";
import Scrollchor from "react-scrollchor";
const OFFSET = 100 // global offset
export function MyScrollchor(props) {
const { children, ...props } = props;
return <Scrollchor {...props} animate={{offset: OFFSET}}>{children}</Scrollchor>
}
and ... my-page.jsx
import MyScrollchor from "./my-scrollchor" as Scrollchor;
...
I will put in the TODO list, create Wiki with some common patterns:
<a>
tags using childless
Scrollchor and simulateClick
PR welcome
I would have animate always with offset an. Can setup custom animation globally?