Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Syamlal CM syamjayaraj

🎯
Focusing
View GitHub Profile
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
View About.jsx
import React from "react";
import {Helmet} from "react-helmet";
function About() {
return (
<div className="about">
<Helmet>
<title>About - yoursite.com</title>
<meta name="description" content="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." />
<link rel="canonical" href="http://mysite.com/example" />
View Footer.jsx
View Navigation.jsx
import React from "react";
function Navigation(props) {
return (
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<a class="navbar-brand" href="#">
React Multi-Language Website
</a>
<div className="language-select">
View index.js
import React from 'react'
import { render } from 'react-dom'
import { Provider } from 'react-redux'
import CounterComponent from './containers/CounterComponent'
import store from './store'
render(
<Provider store={store}>
<CounterComponent />
</Provider>,
View index.js
import {applyMiddleware, createStore} from 'redux'
import logger from 'redux-logger'
import rootReducer from '../reducers'
const store = createStore(rootReducer, applyMiddleware(
logger
))
export default store
View counterReducer.js
const initialState = {
count: 0,
}
function CounterReducer (state = initialState, action){
switch(action.type){
case "INCREMENT_COUNT": {
return {...state, ...action}
}
case "DECREMENT_COUNT": {
View index.js
import {combineReducers} from 'redux'
import CounterReducer from '../reducers/CounterReducer'
export default combineReducers({
counter: CounterReducer,
})
View index.js
export const incrementCount = count => {
const num = count+1
return {
type: 'INCREMENT_COUNT',
count: num
}
}
export const decrementCount = count => {
const num = count - 1
View Button.js
import React from 'react'
const Button = (props) => {
return(
<div>
<button onClick = {props.action} >{props.buttonTitle}</button>
</div>
)
}
You can’t perform that action at this time.