GithubHelp home page GithubHelp logo

online-compiler's Introduction

Online-Code-Editor-using-React---React-Project---18dbxpng63tz

Before We are going to build project npm i Codemirror-2 not supporting in react latest versions above 16V.

Before Running npm install codemirror react-codemirror2 command we need to downgrade our react version.

Steps for Downgrading react version

*Open package.json file and change the react version to <=15.5 >=16.x<=> verison.
*Delete the nodeModules folder & package-lock-json
*After deleteing all these files open the terminal and run <npm intall>

Bulding the Code editor

For building the Code we need to create a sparate component as Editor.jsx. After Creating the Component create a function and export into the App.js After Creating component we need to import some libraies from the Code mirror they are:- < <import "codemirror/lib/codemirror.css"> The above Command contains the style related to text editor that we are going to build <import "codemirror/theme/material.css"> The Above Command contains Themes related data of our editor that we are going to build <import "codemirror/mode/xml/xml"> The Above Command that support to produce Xml(HTML) language to write inside our Code Editor. <import "codemirror/mode/javascript/javascript"> The Above Command that support to produce javaScript(javaScript) language to write inside our Code Editor. <import "codemirror/mode/css/css"> The Above Command that support to produce css(CSS) language to write inside our Code Editor. <import { Controlled as ControlledEditor } from "react-codemirror2"> ControlledEditor is a inbuilt function that is from codemirror which gives access to control the output of these languages , Changes, Themes ,Serial Numbers.

In App.js we have created 2-classes they are :

.pane top-pane:-

    this class contains 3 Divs editors one for HTML&CSS&JS
    Wherewe can write our programming

.pane :-

  This a another Div Class which for our output Block
  in this Div we are using <iframe/> tag which contains data related to codemirror
  1) srcDoc():- Inside the source doc we are proving the HTML&CSS&JS modes
  2)titel:- which Gives the Identification of that tab name
  3)sandBox:- we are giving permission to allow only scripts inside the iframes.
  4)width=100% &Hight=100% &frameBroder=0

online-compiler's People

Contributors

kumarikajal05 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.