@eiendomsprofil/finn-widget-web
v3.0.0
Published
Display Nabolagsprofil on Finn as a widget
Downloads
1,168
Keywords
Readme
Widget on finn.no
Usage
Min height of container should be 320px
import React from 'react'
import ReactDOM from 'react-dom'
import FinnWidget from '@eiendomsprofil/finn-widget-web'
const ENDPOINT = 'https://example.com'
ReactDOM.render(
<FinnWidget
endpoint={ENDPOINT}
config={{
resizeThrottleMs: 150,
scrollThrottleMs: 66,
}}
/>,
container,
)
API
| Name | Type | Default | Params | Description | | --------------- | -------- | ----------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------ | | endpoint | string | '' | - | URL to endpoint | | onLoad | Function | NOOP | Version number | Called once data is successfully loaded from server | | onError | Function | NOOP | info, Version number | Called if error occurs. Possible values: FETCH_ERROR, RENDER_ERROR, MISSING_ENDPOINT | | onScrollStarted | Function | NOOP | Version number | Called when user starts scrolling the widget. Fires only one time | | onScrolledToEnd | Function | NOOP | Version number | Called when user has scrolled to end the of the widget. Fires only one time | | config | object | { resizeThrottleMs: 150, scrollThrottleMs: 66 } | - | Object containing resizeThrottleMs, scrollThrottleMs |