hadron-react-bson
Hadron React Components for BSON values
Usage
Use the getComponent
method to return the correct component for the
provided BSON type.
const React = require('react');
const getComponent = require('hadron-react-bson');
const component = getComponent('String');
React.createElement(component, { type: 'String', value: 'testing' });
Require components directly. Note that if a BSON type does not have a
specific component, it will be handled by the generic Value
component
which calls toString
on the object.
const {
BinaryValue,
CodeValue,
DateValue,
Value,
DoubleValue,
Int32Value,
KeyValue,
RegexValue,
DBRefValue
} = require('hadron-react-bson');