I am trying to use a component via NPM called React-TimeAgo. I have managed to install it via NPM and have Webpack integrated with Rails to generate a webpack bundle our of my node_modules.
This is all working fine when I import a Javascript library (like bootstrap) but not working with this React TimeAgo component. I think its the way I am trying to import from Webpack.
In my index.js I have:
window.bs = require('react-bootstrap') <- this is working
window.timeago = require('react-timeago') <- I don't think this is
And then in the view I have:
<%= react_component "TimeAgo", {date: 'Aug 29, 2014'} %>
But I get a runtime error saying the component TimeAgo could not be found.
What am I missing? Any assistance greatly appreciated.