Skip to content

Commit

Permalink
RN: Delete StyleSheetValidation
Browse files Browse the repository at this point in the history
Summary:
Deletes `StyleSheetValidation` because it is `prop-types` in disguise.

Changelog:
[General][Removed] - `StyleSheet.create` will no longer do DEV-time validation.

Reviewed By: TheSavior

Differential Revision: D29019310

fbshipit-source-id: bfe886d8dc09a1aa8dac4a73bfd62f481e3eb9e9
  • Loading branch information
yungsters authored and facebook-github-bot committed Jun 12, 2021
1 parent 052b3e3 commit 2e8c0bd
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 108 deletions.
2 changes: 0 additions & 2 deletions Libraries/StyleSheet/StyleSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

const PixelRatio = require('../Utilities/PixelRatio');
const ReactNativeStyleAttributes = require('../Components/View/ReactNativeStyleAttributes');
const StyleSheetValidation = require('./StyleSheetValidation');

This comment has been minimized.

Copy link
@gaurav5430

gaurav5430 Dec 24, 2021

Does this mean that there would be no validations anymore ?


const flatten = require('./flattenStyle');

Expand Down Expand Up @@ -363,7 +362,6 @@ module.exports = {
// return value as a number (even though it was opaque).
if (__DEV__) {
for (const key in obj) {
StyleSheetValidation.validateStyle(key, obj);
if (obj[key]) {
Object.freeze(obj[key]);
}
Expand Down
100 changes: 0 additions & 100 deletions Libraries/StyleSheet/StyleSheetValidation.js

This file was deleted.

6 changes: 0 additions & 6 deletions Libraries/StyleSheet/__tests__/flattenStyle-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,9 @@
'use strict';

const StyleSheet = require('../StyleSheet');
const StyleSheetValidation = require('../StyleSheetValidation');
const flattenStyle = require('../flattenStyle');

function getFixture() {
StyleSheetValidation.addValidStylePropTypes({
styleA: () => {},
styleB: () => {},
});

return StyleSheet.create({
elementA: {
styleA: 'moduleA/elementA/styleA',
Expand Down

0 comments on commit 2e8c0bd

Please sign in to comment.