react-firebase-blog
v1.1.0
Published
Blog component powered by Firebase realtime database
Downloads
8
Readme
Firebase Blog for React.js
Blog component powered by Firebase realtime database Markdown supported
Install
npm i react-firebase-blog
or
yarn add react-firebase-blog
How to use
import FireBlog from 'react-firebase-blog';
const config = {
// Firebase Config
apiKey: "API_KEY",
authDomain: "PROJECT_ID.firebaseapp.com",
databaseURL: "https://PROJECT_ID.firebaseio.com",
projectId: "PROJECT_ID",
storageBucket: "PROJECT_ID.appspot.com",
messagingSenderId: "SENDER_ID",
appId: "APP_ID",
measurementId: "G-MEASUREMENT_ID",
}
render() {
return (
<FireBlog config={config} />
);
}
Content of the database
{
"posts" : {
"-M8tXyXVeD81ks4f4XtF" : {
"body" : "Body of the *First Post*",
"date_edited" : 1591177117017,
"slug_name" : "first-post",
"title" : "First Post",
"user" : "John Doe",
"user_pic" : "https://picsum.photos/200/300"
},
"-M8tXyXVeD81ks4f4XtF" : {
"body" : "Body of the *Second Post*",
"date_edited" : 1591177117017,
"slug_name" : "second-post",
"title" : "Second Post",
"user" : "John Doe Jr",
"user_pic" : "https://picsum.photos/200/300"
},
}
}
Copyright
© baptistedftn https://github.com/baptistedftn