Deneme yazı

deneme yazısı için açıklama


Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab, aperiam architecto atque beatae commodi cum deserunt dolorem explicabo minus nihil nulla pariatur porro praesentium quae quaerat sapiente sed unde voluptas.

import React from "react";
import uniquePropHOC from "./lib/unique-prop-hoc";

// this comment is here to demonstrate an extremely long line length, well beyond what you should probably allow in your own code, though sometimes you'll be highlighting code you can't refactor, which is unfortunate but should be handled gracefully

class Expire extends React.Component {
    constructor(props) {
        super(props);
        this.state = { component: props.children }
    }
    componentDidMount() {
        setTimeout(() => {
            this.setState({
                component: null
            });
        }, this.props.time || this.props.seconds * 1000);
    }
    render() {
        return this.state.component;
    }
}

export default uniquePropHOC(["time", "seconds"])(Expire);