Skip to content

Chat App using React, Express, Node, & Socket.io. React hooks practice.

Notifications You must be signed in to change notification settings

chris510/BlueBubbles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Blue Bubbles

Chat App using React, Express, Node, Socket.io. React hooks practice.

General Information

Always wanted to learn how chats work and also wanted to learn more about react hooks so what better way to learn than to practice building a known app. Also wanted to learn more about react's styled components and Socket.io.

Example of React Hooks!

React Class:

const mapStateToProps = state => ({
  loggedIn: state.session.isAuthenticated
});

const dispatchToProps = dispatch => ({
  logout: () => dispatch(logout())
})

export default connect(mapStateToProps, dispatchToProps)(NavBar);

class NavBar extends React.Component {
  constructor(props) {
    super(props);
    this.logoutUser = this.logoutUser.bind(this);
    this.getLink = this.getLink.bind(this);
  }

  logoutUser(e) {
    e.preventDefault();
    this.props.logout();
  }
}

React Hook:

const NavBar = () => {
  const loggedIn = useSelector(state => state.session.isAuthenticated);
  const dispatch = useDispatch();

  const logoutUser = (e) => {
    e.preventDefault();
    dispatch(logout());
  }
}

About

Chat App using React, Express, Node, & Socket.io. React hooks practice.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published