Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
stayScrolled: PropTypes.func.isRequired,
}
componentDidMount() {
const { stayScrolled } = this.props;
stayScrolled();
}
render() {
const { text } = this.props;
return <div>{text}</div>;
}
}
export default scrolled(Message);
))}
);
}
}
Storyline.propTypes = {
storyline: arrayOf(object)
};
Storyline.defaultProps = {
storyline: []
};
export default scrolled(Storyline);
import React, { Component } from 'react';
import { scrolled } from 'react-stay-scrolled';
import PropTypes from 'prop-types';
class Log extends Component {
render() {
return <div>{this.props.message.toLowerCase()}</div>;
}
}
Log.propTypes = {
scrollBottom: PropTypes.func,
message: PropTypes.string,
};
export default scrolled(Log);
};
class Log extends Component {
componentDidMount() {
const { stayScrolled } = this.props;
stayScrolled();
}
render() {
const { log } = this.props;
return <pre>{log}</pre>;
}
}
export default scrolled(Log);