Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

React Liked Component

import React from "react";

const Like = (props) => {
  let classes = "fa fa-heart";
  if (!this.props.liked) classes += "-o";
  return (
    <i
      onClick={this.props.onClick}
      like={this.props.liked}
      className={classes}
      style={{ cursor: "pointer" }}
    ></i>
  );
};

export default Like;
 
PREVIOUS NEXT
Tagged: #React #Liked #Component
ADD COMMENT
Topic
Name
1+8 =