New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-twitter-widgets

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-twitter-widgets - npm Package Compare versions

Comparing version 0.2.4 to 1.0.0

8

dist/components/Timeline.js

@@ -50,3 +50,3 @@ 'use strict';

};
return changed('widgetId') || changed('options');
return changed('dataSource') || changed('options');
}

@@ -57,3 +57,3 @@ }, {

var _props = this.props;
var widgetId = _props.widgetId;
var dataSource = _props.dataSource;
var options = _props.options;

@@ -64,3 +64,3 @@ var onLoad = _props.onLoad;

tw.widgets.createTimeline(widgetId, element, (0, _lodash4.default)(options)).then(function () {
tw.widgets.createTimeline(dataSource, element, (0, _lodash4.default)(options)).then(function () {
// Widget is loaded

@@ -82,3 +82,3 @@ done();

Timeline.propTypes = {
widgetId: _react2.default.PropTypes.string.isRequired,
dataSource: _react2.default.PropTypes.object.isRequired,
options: _react2.default.PropTypes.object,

@@ -85,0 +85,0 @@ onLoad: _react2.default.PropTypes.func

{
"name": "react-twitter-widgets",
"version": "0.2.4",
"version": "1.0.0",
"description": "Twitter widgets as React components",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -23,3 +23,6 @@ # react-twitter-widgets

<Timeline
widgetId={'29838471883830183'}
dataSource={{
sourceType: 'profile',
screenName: 'twitterdev'
}}
options={{

@@ -40,3 +43,3 @@ username: 'TwitterDev',

`Timeline` requires the widget id supplied by Twitter as `widgetId` (ex. `'123456'`). Also, note that you can override your configured screen name with a custom screenName (username) in the options object.
`Timeline` requires a `dataSource` object prop, see [here](https://dev.twitter.com/web/javascript/creating-widgets#timelines) for info. The source type can be profile, likes, list, collection, URL, or legacy widget configuration.

@@ -43,0 +46,0 @@ `Share` requires a `url` prop.

@@ -8,3 +8,3 @@ import React from 'react'

static propTypes = {
widgetId: React.PropTypes.string.isRequired,
dataSource: React.PropTypes.object.isRequired,
options: React.PropTypes.object,

@@ -21,10 +21,10 @@ onLoad: React.PropTypes.func

const changed = name => !isEqual(this.props[name], nextProps[name])
return changed('widgetId') || changed('options')
return changed('dataSource') || changed('options')
}
ready(tw, element, done) {
const { widgetId, options, onLoad } = this.props
const { dataSource, options, onLoad } = this.props
// Options must be cloned since Twitter Widgets modifies it directly
tw.widgets.createTimeline(widgetId, element, cloneDeep(options))
tw.widgets.createTimeline(dataSource, element, cloneDeep(options))
.then(() => {

@@ -31,0 +31,0 @@ // Widget is loaded

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc