react-fx-instrument-dd

React dropdown component list of forex Oanda instruments

Usage no npm install needed!

<script type="module">
  import reactFxInstrumentDd from 'https://cdn.skypack.dev/react-fx-instrument-dd';
</script>

README

react-fx-instrument-dd

React dropdown component list of forex Oanda instruments

NPM JavaScript Style Guide

Install

npm install --save react-fx-instrument-dd

Usage

import React, { Component } from 'react'

// import ExampleComponent from 'react-fx-instrument-dd'
import OandaInstrumentDD from 'react-fx-instrument-dd'

export default class App extends Component {
  constructor(props) {
    super(props);
    this.state = {
        instrument: 'NZD_USD'
    };
    this.onChangeEvent = this.onChangeEvent.bind(this);
  }
  onChangeEvent = (e) => {
    const { name, value } = e.target;
    this.setState({ [name]: value });
  }

  render () {
    const { instrument } = this.state;

    return (
      <div>
        <OandaInstrumentDD name="instrument" onChangeEvent={this.onChangeEvent} instrument={instrument} />
      </div>
    )
  }
}

License

MIT © fespiritu