1. First, we need fresh reactjs setup, and for that, we need to run below commands into out terminal, and also we should have latest node version installed on our system:
npx create-react-app my-awesome-project
cd my-awesome-project
npm start
2. Now we need to run below commands into our project terminal to get bootstrap and related modules into our reactjs application:
npm install [email protected] --save
npm start //For start project again
3. Finally for the main output, we need to add below code into our my-awesome-project/src/App.js file or if you have fresh setup then you can replace my-awesome-project/src/App.js file code with below code:
import React from 'react';
import './App.css';
import 'bootstrap/dist/css/bootstrap.min.css';
function App() {
return (
<div>
<div class="container bootstrap snippets bootdey">
<div class="row">
<div class="col-lg-6 col-lg-offset-3">
<label for="">Please write something and click go</label>
</div>
<div class="input-group col-lg-6 col-lg-offset-3">
<input type="text" class="form-control" id="cyrillic-input"/>
<span class="input-group-btn">
<button class="btn btn-default" id="go-btn" type="button">Go!</button>
</span>
</div>
<div class="col-lg-6 col-lg-offset-3">
<h4 id="utf-result">result:</h4>
</div>
<div class="col-lg-3">
</div>
<div class="col-lg-6 col-lg-offset-3">
<img class="thumbnail img-responsive" id="dumy-img" src="https://dummyimage.com/350x350/5bc0de/fff&text=bootdey.com" title="https://dummyimage.com/350x350/5bc0de/fff&text="/>
</div>
<div class="col-lg-3">
</div>
</div>
</div>
</div>
);
}
export default App;
4. Now we need to add below code into our my-awesome-project/src/App.css file :
body{margin-top:20px;}