brreg-components
v1.1.2
Published
A collection of components to help get accounts from the Brønnøysundregister API, still in early stages, expect changes
Downloads
5
Readme
brreg-components
A collection of components to help get accounts from the Brønnøysundregister API, still in early stages, expect changes
Install
npm install --save brreg-components
Usage
import * as React from 'react'
import {BrregSearcher} from 'brreg-components'
import { IAccount } from 'brreg-components/dist/interfaces/IAccount'
interface Props {
SearchWord: string | undefined;
onChange: (newValue: string | undefined) => void;
}
interface State {
}
export default class BrregSearchComponent extends React.Component<Props, State> {
state = {}
//function is called when the user clicks an account
CallBackFunction(account: IAccount) {
console.log(account)
this.props.onChange(account.OrgNumber)
}
render() {
return (
<div >
<BrregSearcher SearchTerm={"bygg"} SellectedAccountCallback={this.CallBackFunction.bind(this)}></BrregSearcher>
</div>
)
}
}
License
MIT © Ballzer0