-
Notifications
You must be signed in to change notification settings - Fork 47.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
* { all: initial; } in css is breaking the react app #12706
Comments
There's nothing React specific about this, and it can be easily reproduced with the CSS inspector in Chrome and Firefox on all sites, including those that don't use React at all. Among other things, I don't know if this is a bug, but if it is, it's in browsers, not React. |
@nmain How do I prevent this? |
Don't use |
Hey guys,
I have one problem working with any and even simple app of react.
Here is the link of jsfield
anywhere when you use!
Output || Error
* { all:initial; } body { background: #20262E; padding: 20px; font-family: Helvetica; } #app { background: #fff; border-radius: 4px; padding: 20px; transition: all 0.2s; } li { margin: 8px 0; } h2 { font-weight: bold; margin-bottom: 15px; } .done { color: rgba(0, 0, 0, 0.3); text-decoration: line-through; } input { margin-right: 5px; } React window.onload=function(){ class TodoApp extends React.Component { constructor(props) { super(props) this.state = { items: [ { text: "Learn JavaScript", done: false }, { text: "Learn React", done: false }, { text: "Play around in JSFiddle", done: true }, { text: "Build something awesome", done: true } ] } } render() { return ( <div> <h2>Todos:</h2> <ol> {this.state.items.map(item => ( <li key={item.id}> <label> <input type="checkbox" disabled readOnly checked={item.done} /> <span className={item.done ? "done" : ""}>{item.text}</span> </label> </li> ))} </ol> </div> ) } } ReactDOM.render(<TodoApp />, document.querySelector("#app")) } window.onload = function () { let TodoApp = class TodoApp extends React.Component { constructor(props) { super(props); this.state = { items: [{ text: "Learn JavaScript", done: false }, { text: "Learn React", done: false }, { text: "Play around in JSFiddle", done: true }, { text: "Build something awesome", done: true }] }; } render() { return React.createElement( "div", null, React.createElement( "h2", null, "Todos:" ), React.createElement( "ol", null, this.state.items.map(item => React.createElement( "li", { key: item.id }, React.createElement( "label", null, React.createElement("input", { type: "checkbox", disabled: true, readOnly: true, checked: item.done }), React.createElement( "span", { className: item.done ? "done" : "" }, item.text ) ) )) ) ); } }; ReactDOM.render(React.createElement(TodoApp, null), document.querySelector("#app")); }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIklubGluZSBCYWJlbCBzY3JpcHQiXSwibmFtZXMiOlsid2luZG93Iiwib25sb2FkIiwiVG9kb0FwcCIsIlJlYWN0IiwiQ29tcG9uZW50IiwiY29uc3RydWN0b3IiLCJwcm9wcyIsInN0YXRlIiwiaXRlbXMiLCJ0ZXh0IiwiZG9uZSIsInJlbmRlciIsIm1hcCIsIml0ZW0iLCJpZCIsIlJlYWN0RE9NIiwiZG9jdW1lbnQiLCJxdWVyeVNlbGVjdG9yIl0sIm1hcHBpbmdzIjoiOztBQU9BQSxPQUFPQyxNQUFQLEdBQWMsWUFBVTtBQUFBLE1BTWxCQyxPQU5rQixHQU14QixNQUFNQSxPQUFOLFNBQXNCQyxNQUFNQyxTQUE1QixDQUFzQztBQUNwQ0MsZ0JBQVlDLEtBQVosRUFBbUI7QUFDakIsWUFBTUEsS0FBTjtBQUNBLFdBQUtDLEtBQUwsR0FBYTtBQUNaQyxlQUFPLENBQ0wsRUFBRUMsTUFBTSxrQkFBUixFQUE0QkMsTUFBTSxLQUFsQyxFQURLLEVBRUosRUFBRUQsTUFBTSxhQUFSLEVBQXVCQyxNQUFNLEtBQTdCLEVBRkksRUFHSixFQUFFRCxNQUFNLHlCQUFSLEVBQW1DQyxNQUFNLElBQXpDLEVBSEksRUFJSixFQUFFRCxNQUFNLHlCQUFSLEVBQW1DQyxNQUFNLElBQXpDLEVBSkk7QUFESyxPQUFiO0FBUUQ7O0FBRURDLGFBQVM7QUFDUCxhQUNFO0FBQUE7QUFBQTtBQUNFO0FBQUE7QUFBQTtBQUFBO0FBQUEsU0FERjtBQUVFO0FBQUE7QUFBQTtBQUNDLGVBQUtKLEtBQUwsQ0FBV0MsS0FBWCxDQUFpQkksR0FBakIsQ0FBcUJDLFFBQ3BCO0FBQUE7QUFBQSxjQUFJLEtBQUtBLEtBQUtD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cm4gKFxuICAgICAgPGRpdj5cbiAgICAgICAgPGgyPlRvZG9zOjwvaDI+XG4gICAgICAgIDxvbD5cbiAgICAgICAge3RoaXMuc3RhdGUuaXRlbXMubWFwKGl0ZW0gPT4gKFxuICAgICAgICAgIDxsaSBrZXk9e2l0ZW0uaWR9PlxuICAgICAgICAgICAgPGxhYmVsPlxuICAgICAgICAgICAgICA8aW5wdXQgdHlwZT1cImNoZWNrYm94XCIgZGlzYWJsZWQgcmVhZE9ubHkgY2hlY2tlZD17aXRlbS5kb25lfSAvPiBcbiAgICAgICAgICAgICAgPHNwYW4gY2xhc3NOYW1lPXtpdGVtLmRvbmUgPyBcImRvbmVcIiA6IFwiXCJ9PntpdGVtLnRleHR9PC9zcGFuPlxuICAgICAgICAgICAgPC9sYWJlbD5cbiAgICAgICAgICA8L2xpPlxuICAgICAgICApKX1cbiAgICAgICAgPC9vbD5cbiAgICAgIDwvZGl2PlxuICAgIClcbiAgfVxufVxuXG5SZWFjdERPTS5yZW5kZXIoPFRvZG9BcHAgLz4sIGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoXCIjYXBwXCIpKVxuXG5cblxuXG5cbn1cblxuIl19 Todos:Learn JavaScriptLearn ReactPlay around in JSFiddleBuild something awesome // tell the embed parent frame the height of the content if (window.parent && window.parent.parent){ window.parent.parent.postMessage(["resultsFrame", { height: document.body.getBoundingClientRect().height, slug: "None" }], "*") }
The text was updated successfully, but these errors were encountered: