- Press the
like
button to trigger the action of counting like. - Press the
leave message
button to trigger the action of focusing message box. - Leave message to the post.
- The component concept in reactjs.
- Pass parameter from father component to child component by
this.props.xxx
. - Trigger action in child component by
ref
andthis.refs.xxx
. - Lifecycle of a component in reactjs.
(The xxx
above means you can name it any name you want.)
[In assets]
css
includes one file namedbase.css
for all css style code of Facebook template component in this project.data
includes one file namedfbId.js
for recording Facebook id and simulating a Facebook member sign-in.js
includes one file namedfbPage.js
for importing components and showing to client.js
also includes one directory namedcomponents
for containing all reactjs components of this project.
[Out of assets]
index.html
is the entrance point and the file to import all files mentioned above.
- You can start a workspace in cloud 9 and follow commands:
git clone https://github.com/CaraWang/reactjs-fb-like-button-and- leave-message.git
mv learning-reactjs-second-demo-communication-between- components/* .
mv learning-reactjs-second-demo-communication-between- components/.git .
rm -rf learning-reactjs-second-demo-communication-between- components/
- Open
index.html
and press theRun
button in cloud9. - This project starts working in your cloud9!
- When starting to trace code, you can focus on the
render
function infbTemplate.js
which is in assets/js/components. - You can chekout branch to
practice
and start the building trip. - Have a good time with reactjs! <3