Skip to content

Commit

Permalink
bump version 6.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bySabi committed Jul 6, 2018
1 parent d9d8677 commit f7b2859
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 19 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## master (unreleased)

## 6.0.0

`Scrollchor` React component now belong to `Some React Component` Organization Team. This move will ensure its future development and manteniance.

- Added configurable `scrollable container` feature, `target` prop. Thanks to @xephuk dedicated effort.
- [@xehpuk](https://github.com/xehpuk) join `React-Schollchor` Team
- minor Doc corrections

## 5.1.0

- Replace internal function `updateHistory` implementation for prevent scroll jumps on browser history update
Expand Down
10 changes: 0 additions & 10 deletions CONTRIBUTING.md

This file was deleted.

22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ See it in action:
`hash` is the `id` of a HTML tag on current page.



## Installation

### npm
Expand Down Expand Up @@ -108,9 +107,9 @@ export default (props) => (
### Reactive `props`
Update `props` will re-render `Scrollchor` element
Ex: [updating "to" prop](https://github.com/some-react-components/react-scrollchor/blob/example/src/App.js#L28)
Example: [updating "to" prop](https://github.com/some-react-components/react-scrollchor/blob/example/src/App.js#L28)
## Custom animation
## Custom animations
Animation behavior can be customized:
Expand All @@ -132,15 +131,15 @@ This setting is equivalent to default jQuery.animate `easing: swing`
## `before` and `after` Animate callbacks
Use these callbacks to trigger behaviors like, for example, update state, load async stuff, etc.
Use these callbacks to trigger behaviors like: update state, load async stuff, etc.
```js
<Scrollchor to="#aboutus" afterAnimate={() => updateState(this)}>Home</Scrollchor>
```
## Simulate click API
Scrollchor includes a dedicate API for init animate scroll programmatically that works like normal click events using `simulateClick()`.
Scrollchor includes a dedicate API to do animate scroll programmatically that works like normal click events using `simulateClick()`.
Ex: [using simulateClick](https://github.com/some-react-components/react-scrollchor/blob/example/src/App.js#L17)
Example: [using simulateClick](https://github.com/some-react-components/react-scrollchor/blob/example/src/App.js#L16)
When used programmatically, some use-cases don't need `anchor tags`. On these cases use childless `Scrollchor`.
Expand All @@ -149,15 +148,22 @@ This component will render `null` and the user is reponsible for storing the com
```js
<Scrollchor ref={ref => (this._back = ref)} to="_back" />
```
Ex: [calling `simulateClick()` on childless `ref`](https://github.com/some-react-components/react-scrollchor/blob/example/src/App.js#L16)
Example: [calling `simulateClick()` on childless `ref`](https://github.com/some-react-components/react-scrollchor/blob/example/src/App.js#L16)
```js
_afterAnimate = () => {
this.setState({ to: this._iterator.next().value });
setTimeout(() => this._back.simulateClick(), 1000);
};
```
## Example
## Scrollable ancestor container
Scrollchor works within any scrollable parent container. The root element of the `document` will be choose if none is specified.
Hosted example show how to use a different container using prop `target`.
* Click `Within scrollable container` checkbox: [hosted example](https://some-react-components.github.io/react-scrollchor/)(full example below)
## Full Example
[react-scrollchor--example](https://github.com/some-react-components/react-scrollchor/tree/example)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-scrollchor",
"version": "5.1.0",
"version": "6.0.0",
"description": "A React component for scroll to #hash links with smooth animations",
"files": [
"lib"
Expand Down

0 comments on commit f7b2859

Please sign in to comment.