Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import * as RxDB from 'rxdb';
import {QueryChangeDetector} from 'rxdb';
import { schema } from './Schema';
import { ToastContainer, toast } from 'react-toastify';
// The following line is not needed for react-toastify v3, only for v2.2.1
//import 'react-toastify/dist/ReactToastify.min.css';
import * as moment from 'moment';
QueryChangeDetector.enable();
QueryChangeDetector.enableDebugging();
RxDB.plugin(require('pouchdb-adapter-idb'));
RxDB.plugin(require('pouchdb-adapter-http'));
const syncURL = 'http://localhost:5984/';
const dbName = 'chatdb';
class App extends Component {
constructor(props) {
super(props);
this.state = {
newMessage: '', messages: []
};
this.subs = [];
this.addMessage = this.addMessage.bind(this);