department-of-veterans-affairs/vets-website

View on GitHub
src/applications/static-pages/homepage-email-signup/index.js

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import EmailSignup from './EmailSignup';
import './email-signup.scss';

export default (store, widgetType) => {
  const root = document.querySelector(`[data-widget-type="${widgetType}"]`);

  if (!root) {
    return;
  }

  ReactDOM.render(
    <Provider store={store}>
      <EmailSignup />
    </Provider>,
    root,
  );
};